From a2c1b918caaf2598c7f50ec299857146f264967c Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Tue, 13 Jul 2021 06:06:48 +0000 Subject: [PATCH] Fix --- create.sh | 3 ++- tool_generate.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/create.sh b/create.sh index 73de563..84c0cc4 100755 --- a/create.sh +++ b/create.sh @@ -1,8 +1,9 @@ #!/bin/bash -set -e export WG_MYPRIK=$(wg genkey) export WG_MYPUBK=$(echo $WG_MYPRIK | wg pubkey) python3 tool_create.py python3 tool_generate.py + +chmod +x start.sh diff --git a/tool_generate.py b/tool_generate.py index 477e31b..a02ad6c 100644 --- a/tool_generate.py +++ b/tool_generate.py @@ -13,6 +13,7 @@ except Exception: udp_clients = config["udp2raw"]["client"] udp_servers = config["udp2raw"]["server"] +print("Generating wireguard config...") with open("{}.conf".format(config["interface"]), "w", encoding='utf-8') as f: f.write('''[Interface] Address = {} @@ -31,9 +32,11 @@ AllowedIPs = {} if info["keepalive"]: f.write("PersistentKeepalive = {}".format(info["keepalive"])) + +print("Generating start script...") with open("start.sh", "w", encoding='utf-8') as f: f.write('''#!/bin/bash -set -x +set -e cp {}.conf /etc/wireguard/ tmux new-session -s tunnel -d