summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Crute <mcrute@gmail.com>2010-04-12 02:40:09 +0000
committerMichael Crute <mcrute@gmail.com>2010-04-12 02:40:09 +0000
commit531cff0c341dd1e282da245af0c320bbfb0a47a7 (patch)
treede97f582eec911720b987dfcacb12f942022aeca
parentde0b7ec62a243a30201362a2d5c5e5990a4b4e11 (diff)
downloadiptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.tar.bz2
iptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.tar.xz
iptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.zip
Adding debian init script
-rwxr-xr-xinit/debian.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/init/debian.sh b/init/debian.sh
new file mode 100755
index 0000000..b3cfc4a
--- /dev/null
+++ b/init/debian.sh
@@ -0,0 +1,50 @@
1#! /bin/sh
2
3### BEGIN INIT INFO
4# Provides: iptables
5# Required-Start: $all
6# Required-Stop: $all
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: starts the iptables firewall
10# Description: starts iptables
11### END INIT INFO
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14DAEMON=/root/bin/firewall
15NAME=iptables
16DESC=iptables
17LOG_FILE=/var/log/iptables.log
18
19test -x $DAEMON || exit 0
20
21# Include nginx defaults if available
22if [ -f /etc/default/iptables ] ; then
23 . /etc/default/iptables
24fi
25
26set -e
27
28case "$1" in
29 start)
30 echo "Starting $DESC: "
31 $DAEMON $RULES | tee -a $LOG_FILE
32 ;;
33 stop)
34 echo "Stopping $DESC: "
35 $DAEMON --flush | tee -a $LOG_FILE
36 ;;
37 restart|force-reload|reload)
38 echo "Restarting $DESC: "
39 $DAEMON --flush | tee -a $LOG_FILE
40 sleep 1
41 $DAEMON $RULES | tee -a $LOG_FILE
42 ;;
43 *)
44 N=/etc/init.d/$NAME
45 echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
46 exit 1
47 ;;
48esac
49
50exit 0