mirror of
https://github.com/Kiritow/wg-ops.git
synced 2024-03-22 13:11:37 +08:00
Minor fix
Permission fix, script generation fix.
This commit is contained in:
parent
7a94df6b1f
commit
dc88a93914
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ __pycache__/
|
|||
*.conf
|
||||
start.sh
|
||||
stop.sh
|
||||
restart.sh
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
''')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user