Update 'set_gateway.sh'

Removed static host value and change it to set from the endpoint variable of wireguard config actualy
This commit is contained in:
Gyorgy Berenyi
2023-04-07 10:10:39 +00:00
parent c7c6d48fad
commit 6c11c45756

View File

@@ -1,4 +1,5 @@
#!/bin/sh
ENDPOINT=$(cat /etc/wireguard/wg0.conf | grep Endpoint | awk '{print $3}' |cut -d ':' -f1)
IP_GATEWAY=$(route -n | grep 'UG[ \t]' | awk '{print $2}');
route add -host vps.vizpartingatlan.hu gw $IP_GATEWAY
route add -host $ENDPOINT gw $IP_GATEWAY