читал книгу Гильдебрандта ничего не понятно
#! /bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $syslog $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Fill iptables rules
### END INIT INFO
ip=/sbin/iptables
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
INPUT
FORWARD
OUTPUT
do_stop (){
$ip -F
$ip -t nat -F
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
cat /etc/systemd/system/firewall.service
[Unit]
Description=Firewall_iptables
After=syslog.target
After=network.target
[Service]
Type=forking
ExecStart=/etc/init.d/firewall start
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target