summaryrefslogtreecommitdiffstats
path: root/roles/gateway/templates/gateway-init.service.j2
blob: 4fec5d226c9382ca0dbb32c9f892b4ee522d249b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[Unit]
Description=Gateway Init Service
Documentation=man:systemd.service(5)
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
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target