Log the name of the config in use

This commit is contained in:
Martin 2019-09-23 11:28:36 +02:00
parent 7a95b46c73
commit a8e02ddcd3
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
{ {
"host": "nice.wafe.eu", "host": "rusty.wafe.eu",
"user": "tunnel", "user": "tunnel",
"mapping": [ "mapping": [
{ {

View file

@ -19,13 +19,14 @@ if __name__ == "__main__":
for path in sys.argv[1:]: for path in sys.argv[1:]:
try: try:
cfg = load_cfg(path) cfg = load_cfg(path)
print("> using %s" %(path))
break break
except Exception as e: except Exception as e:
print("! cfg file %s failed to load (%s)" %(path, e)) print("! cfg file %s failed to load (%s)" %(path, e))
if not cfg: if not cfg:
print("!!! unable to load any configuration") print("! unable to load any configuration")
sys.exit(1) sys.exit(1)
command = ["/usr/bin/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"]
@ -36,5 +37,4 @@ if __name__ == "__main__":
command.append("%s@%s" %(cfg["user"], cfg["host"])) command.append("%s@%s" %(cfg["user"], cfg["host"]))
# replace this process, systemd will restart us if needed
subprocess.run(command) subprocess.run(command)