summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/gateway/templates/gateway-init.service.j24
1 files changed, 4 insertions, 0 deletions
diff --git a/roles/gateway/templates/gateway-init.service.j2 b/roles/gateway/templates/gateway-init.service.j2
index 8b4635d8..4fec5d22 100644
--- a/roles/gateway/templates/gateway-init.service.j2
+++ b/roles/gateway/templates/gateway-init.service.j2
@@ -5,6 +5,10 @@ After=network.target
[Service]
Type=oneshot
+# Both commands run at boot to handle either scenario:
+# - If VPN autostart is enabled: vpn applies rules, direct ignores (VPN active)
+# - If no VPN autostart: vpn ignores (no interfaces), direct applies rules
+# The gateway-apply-rules script checks interface state and only applies appropriate rules
ExecStart=/usr/local/bin/gateway-apply-rules vpn
ExecStart=/usr/local/bin/gateway-apply-rules direct
User=root