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
|
#!/bin/bash
#
# filter Apply packet filtering rules
#
# chkconfig: 2345 5 95
# description: Apply / remove packet filtering rules
#
# probe: true
# Source function library.
. /etc/init.d/functions
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
case "$1" in
start|restart|reload)
action $"Loading packet filter rules" make -C /etc/filter install
;;
stop)
action $"Not removing packet filter rules" true
;;
accept)
action $"Flushing firewall rules, default accept" make -C /etc/filter accept
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|accept}"
exit 1
esac
exit 0
|