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