fix(network-manager): ensure wireguard endpoint routes via default gateway

This commit is contained in:
2026-08-30 20:46:51 -04:00
parent 40e8237819
commit 76c8fd9ae2
@@ -0,0 +1,15 @@
#!/bin/sh
ENDPOINT=129.100.33.20
case "$2" in
up|dhcp4-change)
route=$(ip -4 route show default | awk 'NR==1')
gateway=$(echo "$route" | awk '{for (i=1;i<=NF;i++) if ($i=="via") print $(i+1)}')
device=$(echo "$route" | awk '{for (i=1;i<=NF;i++) if ($i=="dev") print $(i+1)}')
if [ -n "$gateway" ] && [ -n "$device" ]; then
ip -4 route replace "$ENDPOINT/32" via "$gateway" dev "$device"
fi
;;
esac