diff --git a/src/cmdctl.py b/src/cmdctl.py index 283607a..45f468e 100644 --- a/src/cmdctl.py +++ b/src/cmdctl.py @@ -69,9 +69,11 @@ class CmdCtl: return exitcode, data @classmethod - def sudo_run_cmd(cls, command, interrupt=True, timeout=25, out_debug_flag=True, command_log=True): + def sudo_run_cmd(cls, command, interrupt=True, timeout=25, out_debug_flag=True, command_log=True, password=None): + if password is None: + password = conf.PASSWORD cls.run_cmd( - f"echo '{conf.PASSWORD}' | sudo -S {command}", + f"echo '{password}' | sudo -S {command}", interrupt=interrupt, timeout=timeout, out_debug_flag=out_debug_flag,