use systemv manager the auto boot script and servcie
Init scripts are typically stored in the /etc/init.d/ directory and are started using the init process, which is the first process started by the Linux kernel.
Write the init script with systemv style
cat /etc/init.d/demo-service
1#!/usr/bin/env bash
2
3### BEGIN INIT INFO
4# Provides: restore-iptables
5# Required-Start:
6# Required-Stop:
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: load iptables rule when reboot
10# Description: Automation restore the iptables rule from file, when system is reboot.
11### END INIT INFO
12
13iptables-restore < /root/iptables.txt
To enable and install the systemv bootstrap script
1# install the service
2update-rc.d demo-service defaults
3# enable a service
4update-rc.d demo-service enable
5# disalbe the service
6update-rc.d demo-service disable
7# forcibly remove the service
8update-rc.d -f demo-service remove
9# Also use systemctl
10systemctl status load-iptables