mirror of
https://github.com/Kiritow/wg-ops.git
synced 2024-03-22 13:11:37 +08:00
Fix
This commit is contained in:
parent
6bdc1f34f1
commit
a2c1b918ca
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
|
||||||
|
|
||||||
export WG_MYPRIK=$(wg genkey)
|
export WG_MYPRIK=$(wg genkey)
|
||||||
export WG_MYPUBK=$(echo $WG_MYPRIK | wg pubkey)
|
export WG_MYPUBK=$(echo $WG_MYPRIK | wg pubkey)
|
||||||
|
|
||||||
python3 tool_create.py
|
python3 tool_create.py
|
||||||
python3 tool_generate.py
|
python3 tool_generate.py
|
||||||
|
|
||||||
|
chmod +x start.sh
|
||||||
|
|
|
@ -13,6 +13,7 @@ except Exception:
|
||||||
udp_clients = config["udp2raw"]["client"]
|
udp_clients = config["udp2raw"]["client"]
|
||||||
udp_servers = config["udp2raw"]["server"]
|
udp_servers = config["udp2raw"]["server"]
|
||||||
|
|
||||||
|
print("Generating wireguard config...")
|
||||||
with open("{}.conf".format(config["interface"]), "w", encoding='utf-8') as f:
|
with open("{}.conf".format(config["interface"]), "w", encoding='utf-8') as f:
|
||||||
f.write('''[Interface]
|
f.write('''[Interface]
|
||||||
Address = {}
|
Address = {}
|
||||||
|
@ -31,9 +32,11 @@ AllowedIPs = {}
|
||||||
if info["keepalive"]:
|
if info["keepalive"]:
|
||||||
f.write("PersistentKeepalive = {}".format(info["keepalive"]))
|
f.write("PersistentKeepalive = {}".format(info["keepalive"]))
|
||||||
|
|
||||||
|
|
||||||
|
print("Generating start script...")
|
||||||
with open("start.sh", "w", encoding='utf-8') as f:
|
with open("start.sh", "w", encoding='utf-8') as f:
|
||||||
f.write('''#!/bin/bash
|
f.write('''#!/bin/bash
|
||||||
set -x
|
set -e
|
||||||
|
|
||||||
cp {}.conf /etc/wireguard/
|
cp {}.conf /etc/wireguard/
|
||||||
tmux new-session -s tunnel -d
|
tmux new-session -s tunnel -d
|
||||||
|
|
Loading…
Reference in New Issue
Block a user