overheat monitor with auto poweroff
- needs passwordless sudo on target machine or deploy to run as root
This commit is contained in:
@@ -16,6 +16,7 @@ SCRIPT_DIR = Path(__file__).parent.resolve()
|
||||
PROJECT_ROOT = SCRIPT_DIR.parent
|
||||
CONFIG_FILE = SCRIPT_DIR / "deploy_target.json"
|
||||
BUILD_DIR = PROJECT_ROOT / "pi" / "ui" / "build" / "elinux" / "arm64" / "release" / "bundle"
|
||||
CONFIG_SRC = PROJECT_ROOT / "pi" / "ui" / "config.json"
|
||||
|
||||
|
||||
def run(cmd: list[str], check: bool = True, **kwargs) -> subprocess.CompletedProcess:
|
||||
@@ -63,6 +64,19 @@ def deploy(restart: bool = False) -> bool:
|
||||
f"{ssh_target}:{remote_path}/bundle/",
|
||||
])
|
||||
|
||||
# Sync config.json (sits next to executable in bundle)
|
||||
if CONFIG_SRC.exists():
|
||||
print()
|
||||
print("Syncing config.json...")
|
||||
run([
|
||||
"rsync", "-avz",
|
||||
str(CONFIG_SRC),
|
||||
f"{ssh_target}:{remote_path}/bundle/config.json",
|
||||
])
|
||||
else:
|
||||
print()
|
||||
print("Note: No config.json found, using defaults")
|
||||
|
||||
# Restart service if requested
|
||||
if restart:
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user