iptables-helper/iptables-helper.service

16 lines
448 B
SYSTEMD
Raw Permalink Normal View History

[Unit]
Description=Iptables Helper
After=network.target
[Service]
Environment="HOME=/root"
WorkingDirectory=/opt/iptables-helper
2023-11-06 16:01:45 +08:00
ExecStartPre=/bin/bash -c "[ -f /etc/iptables.rule ] && iptables-restore /etc/iptables.rule || exit 0;"
ExecStart=/opt/iptables-helper/iptables-helper
2023-11-06 16:01:45 +08:00
ExecStartPost=/bin/bash -c "iptables-save | tee /etc/iptables.rule > /dev/null"
Restart=on-failure
KillMode=process
RestartSec=5s
[Install]
WantedBy=multi-user.target