init.d: add a specefic init script for debian
This commit is contained in:
parent
8e2e27f2b9
commit
357c024fd3
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: firewall
|
||||
# Required-Start: $remote_fs $syslog $network
|
||||
# Required-Stop: $remote_fs $syslog $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Iptables firewall
|
||||
# Description: An iptables firewall
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
NAME="eofirewall"
|
||||
SCRIPT="/usr/bin/$NAME"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting firewall"
|
||||
/usr/bin/$NAME load || exit 1
|
||||
log_end_msg 0
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping firewall"
|
||||
/usr/bin/$NAME clean || exit 1
|
||||
log_end_msg 0
|
||||
;;
|
||||
restart|reload)
|
||||
log_daemon_msg "Reloading firewall"
|
||||
/usr/bin/$NAME clean || exit 1
|
||||
/usr/bin/$NAME load || exit 1
|
||||
log_end_msg 0
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|restart|reload}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -12,5 +12,3 @@
|
|||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit --name=firewall
|
||||
|
|
Reference in New Issue