diff --git a/set_gateway.sh b/set_gateway.sh index eae3c47..fa2941c 100755 --- a/set_gateway.sh +++ b/set_gateway.sh @@ -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