diff options
author | Michael Crute <mcrute@gmail.com> | 2010-04-12 02:40:09 +0000 |
---|---|---|
committer | Michael Crute <mcrute@gmail.com> | 2010-04-12 02:40:09 +0000 |
commit | 531cff0c341dd1e282da245af0c320bbfb0a47a7 (patch) | |
tree | de97f582eec911720b987dfcacb12f942022aeca | |
parent | de0b7ec62a243a30201362a2d5c5e5990a4b4e11 (diff) | |
download | iptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.tar.bz2 iptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.tar.xz iptables_scripts-531cff0c341dd1e282da245af0c320bbfb0a47a7.zip |
Adding debian init script
-rwxr-xr-x | init/debian.sh | 50 |
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 | |||
13 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
14 | DAEMON=/root/bin/firewall | ||
15 | NAME=iptables | ||
16 | DESC=iptables | ||
17 | LOG_FILE=/var/log/iptables.log | ||
18 | |||
19 | test -x $DAEMON || exit 0 | ||
20 | |||
21 | # Include nginx defaults if available | ||
22 | if [ -f /etc/default/iptables ] ; then | ||
23 | . /etc/default/iptables | ||
24 | fi | ||
25 | |||
26 | set -e | ||
27 | |||
28 | case "$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 | ;; | ||
48 | esac | ||
49 | |||
50 | exit 0 | ||