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
|
#!/bin/sh
#
# fwctl This shell script takes care of configuring the firewall
# using fwctl.
#
# description: Configure the IP packet filtering firewall
#
# changes for Debian from <ecki@debian.org> Bernd Eckenfels
# Warning: if you put "fwctl stop" here your system is cut off the net
# stop_action="stop"
stop_action="flush"
interfaces=/etc/fwctl/interfaces
[ -x /usr/sbin/fwctl ] || exit 0;
# See how we were called.
case "$1" in
start)
# Is the package configured yet?
$0 isconfigured < $interfaces >/dev/null && exit 0
echo -n "Starting IP packet filters: "
/usr/sbin/fwctl start
echo "fwctl."
;;
stop)
# Stop daemons.
echo -n "Stopping IP packet filters: "
/usr/sbin/fwctl $stop_action
echo "fwctl."
;;
check)
fwctl check
;;
isconfigured)
egrep -v '^[ ]*$|^#' >/dev/null || exit 0
exit 1
;;
restart|force-reload)
echo -n "Restarting IP packet filters: "
fwctl restart
echo "fwctl."
;;
*)
echo "Usage: fwctl {start|stop|check|restart|force-reload}"
exit 1
esac
exit 0
|