Fix: Add route on wireguard reload

This should be done by wg-quick. However wg-quick does not provide a sync command.
This commit is contained in:
Kirigaya Kazuto 2021-08-22 07:31:09 +00:00
parent e0acc71be4
commit 8bb3dcda9f

View File

@ -156,6 +156,9 @@ sudo cp local/{}.conf /etc/wireguard/
sudo -- bash -c "wg syncconf {} <(wg-quick strip {})" sudo -- bash -c "wg syncconf {} <(wg-quick strip {})"
'''.format(config["interface"], config["interface"], config["interface"])) '''.format(config["interface"], config["interface"], config["interface"]))
for info in config["peers"]:
f.write("sudo ip -4 route add {} dev {}\n".format(info["allowed"]), config["interface"])
logger.info('''[Done] Config generated. Before you run start.sh, besure to: logger.info('''[Done] Config generated. Before you run start.sh, besure to:
1. Disable SSH Server password login. 1. Disable SSH Server password login.