From 6c11c45756eec78721aae43a00c0c024e7c2c10b Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Fri, 7 Apr 2023 10:10:39 +0000 Subject: [PATCH] Update 'set_gateway.sh' Removed static host value and change it to set from the endpoint variable of wireguard config actualy --- set_gateway.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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