use subprocess instead

This commit is contained in:
Martin 2019-09-13 19:24:55 +02:00
parent 22328683ea
commit c2acfa6431
2 changed files with 5 additions and 5 deletions

View file

@ -20,11 +20,11 @@ package() {
cd $pkgname
# prepare dirs
install -dm755 "$pkgdir/usr/bin"
install -dm755 "$pkgdir/usr/lib/safe-harbor"
install -dm755 "$pkgdir/usr/lib/systemd/system"
install -dm755 "$pkgdir/etc/safe-harbor"
cp bin/safe-harbor.py "$pkgdir/usr/bin"
cp bin/safe-harbor.py "$pkgdir/usr/lib/safe-harbor"
cp systemd/safe-harbor@.service "$pkgdir/usr/lib/systemd/system"
cp config.json.example "$pkgdir/etc/safe-harbor"
}

View file

@ -3,7 +3,7 @@
import jsmin
import json
import os
import subprocess
import sys
if __name__ == "__main__":
@ -15,7 +15,7 @@ if __name__ == "__main__":
with open(cfg_path) as f:
cfg = json.loads(jsmin.jsmin(f.read()))
command = ["/usr/bin/ssh", "ssh", "-o", "ServerAliveInterval 45", "-o", "ServerAliveCountMax 2", "-o", "ExitOnForwardFailure yes", "-N"]
command = ["/usr/bin/ssh", "-o", "ServerAliveInterval 45", "-o", "ServerAliveCountMax 2", "-o", "ExitOnForwardFailure yes", "-N"]
for m in cfg["mapping"]:
command.append("-R")
@ -24,4 +24,4 @@ if __name__ == "__main__":
command.append("%s@%s" %(cfg["user"], cfg["host"]))
# replace this process, systemd will restart us if needed
os.execl(*command)
subprocess.run(command)