diff --git a/systemd-templates/set-ip-routes.path b/systemd-templates/set-ip-routes.path index fd19792..346826b 100644 --- a/systemd-templates/set-ip-routes.path +++ b/systemd-templates/set-ip-routes.path @@ -2,7 +2,7 @@ Description=Detect WireGuard VPN activation [Path] -PathExists=/sys/class/net/wg0 +PathExists=/sys/class/net/wg0/dev_id Unit=set-ip-routes.service [Install] diff --git a/systemd-templates/set-ip-routes.service b/systemd-templates/set-ip-routes.service index 86e22ef..21b8c7c 100644 --- a/systemd-templates/set-ip-routes.service +++ b/systemd-templates/set-ip-routes.service @@ -3,6 +3,7 @@ Description=Update IP routes after connecting to VPN [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/sbin/ip route del default dev wg0 ExecStart=/usr/sbin/ip route add PH_DNS dev wg0 ExecStart=/usr/sbin/ip route add PH_NETWORK dev wg0