summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-04-28 20:31:02 -0400
committerMike Crute <mcrute@gmail.com>2010-04-28 20:31:02 -0400
commit5440e44cdad939887a3ef351f8d8d83f2791ae44 (patch)
treefa7c2005b1b41618a3d4ea00415abb252ee409eb
parent5619405526d9586d382779ad929f1ccc2be5d9f7 (diff)
parent531cff0c341dd1e282da245af0c320bbfb0a47a7 (diff)
downloadiptables_scripts-5440e44cdad939887a3ef351f8d8d83f2791ae44.tar.bz2
iptables_scripts-5440e44cdad939887a3ef351f8d8d83f2791ae44.tar.xz
iptables_scripts-5440e44cdad939887a3ef351f8d8d83f2791ae44.zip
Merging in changes.
-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