1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/bin/sh
#
# /etc/rc.d/rc.firewall: Shoreline Firewall (Shorewall) initialization script.
#
# This script starts both the IPv4 and IPv6 rules of shorewall if the respective
# initialization scripts (rc.shorewall and rc.shorewall6) are present
#
# http://rafb.net/p/k0OiyI67.html
start() {
if [ -x /etc/rc.d/rc.shorewall ]; then
/etc/rc.d/rc.shorewall start
fi
if [ -x /etc/rc.d/rc.shorewall6 ]; then
/etc/rc.d/rc.shorewall6 start
fi
}
stop() {
if [ -x /etc/rc.d/rc.shorewall ]; then
/etc/rc.d/rc.shorewall stop
fi
if [ -x /etc/rc.d/rc.shorewall6 ]; then
/etc/rc.d/rc.shorewall6 stop
fi
}
restart() {
if [ -x /etc/rc.d/rc.shorewall ]; then
/etc/rc.d/rc.shorewall restart
fi
if [ -x /etc/rc.d/rc.shorewall6 ]; then
/etc/rc.d/rc.shorewall6 restart
fi
}
status() {
if [ -x /etc/rc.d/rc.shorewall ]; then
/etc/rc.d/rc.shorewall status
fi
if [ -x /etc/rc.d/rc.shorewall6 ]; then
/etc/rc.d/rc.shorewall6 status
fi
}
export SHOREWALL_INIT_SCRIPT=1
case $1 in
'start')
start
;;
'stop')
stop
;;
'restart')
restart
;;
'status')
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
;;
esac
exit 0
# All done
|