fixy
This commit is contained in:
10
app.py
10
app.py
@@ -74,15 +74,15 @@ def serviceCommand(name: str):
|
||||
return f"systemctl reload {name}"
|
||||
|
||||
def runCmd(cmd: str):
|
||||
"""Uruchamia komendę w shellu z timeoutem i logowaniem."""
|
||||
logger.info(f"Exec: {cmd}")
|
||||
try:
|
||||
env = os.environ.copy()
|
||||
env["PATH"] = getCfg("exec_path", DEFAULT_EXEC_PATH) or DEFAULT_EXEC_PATH
|
||||
out = subprocess.run(
|
||||
cmd, shell=True, capture_output=True, text=True, timeout=RELOAD_TIMEOUT
|
||||
cmd, shell=True, capture_output=True, text=True,
|
||||
timeout=RELOAD_TIMEOUT, env=env
|
||||
)
|
||||
stdout = (out.stdout or "").strip()
|
||||
stderr = (out.stderr or "").strip()
|
||||
return out.returncode, stdout, stderr
|
||||
return out.returncode, (out.stdout or "").strip(), (out.stderr or "").strip()
|
||||
except subprocess.TimeoutExpired:
|
||||
return 124, "", "Timeout"
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
[daemon]
|
||||
API_TOKEN = apitoken
|
||||
|
||||
backup_path= /backup
|
||||
|
||||
services = dnsmasq
|
||||
|
||||
# opcjonalnie: globalny timeout (sekundy)
|
||||
|
Reference in New Issue
Block a user