Add Torrent auto-config

This commit is contained in:
Colin Hebert
2023-04-11 07:37:57 +10:00
parent 65a8285f2e
commit 77a5fc756c
5 changed files with 51 additions and 39 deletions

View File

@@ -0,0 +1,6 @@
#!/command/with-contenv bash
wgserver=$(grep Endpoint "${CONFIG_DIR}/wireguard/wg0.conf" | awk '{print $3}')
gateway=$(ip -o -4 route show to default | awk '{print $3}')
ip -4 route add ${wgserver%:*} via ${gateway} dev eth0