init.d: add a specefic init script for debian

This commit is contained in:
Jérôme Schneider 2013-11-15 10:33:42 +01:00
parent 8e2e27f2b9
commit 357c024fd3
2 changed files with 43 additions and 2 deletions

43
debian/init.d vendored Normal file
View File

@ -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

2
debian/rules vendored
View File

@ -12,5 +12,3 @@
%:
dh $@
override_dh_installinit:
dh_installinit --name=firewall