2008-12-09 17:50:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
OPTIONS="-f"
|
|
|
|
|
2008-12-31 19:08:36 +01:00
|
|
|
if [ -f /etc/sysconfig/shorewall6 ] ; then
|
|
|
|
. /etc/sysconfig/shorewall6
|
|
|
|
elif [ -f /etc/default/shorewall6 ] ; then
|
|
|
|
. /etc/default/shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-31 19:08:36 +01:00
|
|
|
# if you want to override options, do so in /etc/sysconfig/shorewall6 or
|
|
|
|
# in /etc/default/shorewall6 --
|
2008-12-09 17:50:17 +01:00
|
|
|
# i strongly encourage you use the latter, since /etc/sysconfig/ does not exist.
|
|
|
|
|
|
|
|
. /etc/rc.conf
|
|
|
|
. /etc/rc.d/functions
|
|
|
|
|
2008-12-31 19:08:36 +01:00
|
|
|
DAEMON_NAME="shorewall6" # of course shorewall6 is NOT a deamon.
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2009-06-07 17:07:56 +02:00
|
|
|
export SHOREWALL_INIT_SCRIPT=1
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
stat_busy "Starting $DAEMON_NAME"
|
2008-12-31 19:08:36 +01:00
|
|
|
/sbin/shorewall6 $OPTIONS start &>/dev/null
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
add_daemon $DAEMON_NAME
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
stop)
|
|
|
|
stat_busy "Stopping $DAEMON_NAME"
|
2008-12-31 19:08:36 +01:00
|
|
|
/sbin/shorewall6 stop &>/dev/null
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
rm_daemon $DAEMON_NAME
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart|reload)
|
|
|
|
stat_busy "Restarting $DAEMON_NAME"
|
2008-12-31 19:08:36 +01:00
|
|
|
/sbin/shorewall6 restart &>/dev/null
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop|restart}"
|
|
|
|
esac
|
|
|
|
exit 0
|
|
|
|
|