Files
wireguard-proxy-client/set_gateway.sh
Gyorgy Berenyi 6c11c45756 Update 'set_gateway.sh'
Removed static host value and change it to set from the endpoint variable of wireguard config actualy
2023-04-07 10:10:39 +00:00

6 lines
203 B
Bash
Executable File

#!/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 $ENDPOINT gw $IP_GATEWAY