56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
|
#! /bin/sh
|
||
|
# Copyright (c) 1996 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
||
|
#
|
||
|
# Author: Burchard Steinbild <bs@suse.de>, 1996
|
||
|
#
|
||
|
# adapted to scanlogd by Ulrich Hecht <uli@suse.de>, 1999
|
||
|
# re-adapted to iptables by Shane Chen <shane@knowplace.org>, 2001
|
||
|
#
|
||
|
# /etc/init.d/iptables
|
||
|
#
|
||
|
# chkconfig: 2345 11 92
|
||
|
# description: Netfilter Automatic Rules Configurator (packet filtering firewall with iptables)
|
||
|
|
||
|
. /etc/narc/narc.conf
|
||
|
source /etc/init.d/functions
|
||
|
|
||
|
base=${0##*/}
|
||
|
link=${base#*[SK][0-9][0-9]}
|
||
|
|
||
|
test $link = $base && START_IPTABLES=yes
|
||
|
test "$START_IPTABLES" = "yes" || exit 0
|
||
|
|
||
|
rc_done=" done"
|
||
|
rc_failed=" failed"
|
||
|
|
||
|
return=$rc_done
|
||
|
case "$1" in
|
||
|
start)
|
||
|
echo -n "Starting iptables"
|
||
|
/usr/sbin/narc start || return=$rc_failed
|
||
|
evaluate_retval
|
||
|
echo -e "$return"
|
||
|
;;
|
||
|
stop)
|
||
|
echo -n "Stopping iptables"
|
||
|
/usr/sbin/narc stop || return=$rc_failed
|
||
|
evaluate_retval
|
||
|
echo -e "$return"
|
||
|
;;
|
||
|
restart|reload)
|
||
|
$0 stop && $0 start || return=$rc_failed
|
||
|
evaluate_retval
|
||
|
|
||
|
;;
|
||
|
status)
|
||
|
/usr/sbin/narc status && echo OK || echo No process
|
||
|
evaluate_retval
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: $0 {start|stop|restart|status}"
|
||
|
exit 1
|
||
|
esac
|
||
|
|
||
|
test "$return" = "$rc_done" || exit 1
|
||
|
exit 0
|