diff --git a/.gitignore b/.gitignore index 4e24f46..b40147e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ __pycache__/ *.conf start.sh stop.sh +restart.sh diff --git a/tool_create.py b/tool_create.py index 9925187..c0b109e 100755 --- a/tool_create.py +++ b/tool_create.py @@ -218,7 +218,7 @@ while True: peer_keepalive = input("Enter Wireguard Peer Keep Alive seconds (default to 30): ").strip() or "30" else: peer_endpoint = "" - peer_keepalive = "30" + peer_keepalive = "" config["peers"].append({ "pubkey": peer_pubk, diff --git a/tool_generate.py b/tool_generate.py index 552e569..714e22d 100644 --- a/tool_generate.py +++ b/tool_generate.py @@ -46,7 +46,7 @@ AllowedIPs = {} if info["keepalive"]: f.write("PersistentKeepalive = {}\n".format(info["keepalive"])) -os.system("chmod 600 {}.conf".format(config["interface"])) +os.system("chmod 600 local/{}.conf".format(config["interface"])) logger.info("Generating start script...") with open("start.sh", "w", encoding='utf-8') as f: @@ -89,6 +89,7 @@ tmux attach-session -t tunnel logger.info("Generating stop script...") with open("stop.sh", "w", encoding='utf-8') as f: f.write('''#!/bin/bash +set -x wg-quick down {} tmux kill-session -t tunnel '''.format(config["interface"])) @@ -97,7 +98,9 @@ tmux kill-session -t tunnel logger.info("Generating restart script...") with open("restart.sh", "w", encoding='utf-8') as f: f.write('''#!/bin/bash -./stop.sh && ./start.sh +set -x +./stop.sh +./start.sh ''')