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