iptables-helper/iptables-helper.service
2023-11-06 16:01:45 +08:00

16 lines
448 B
Desktop File

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