#!/bin/sh #!/bin/sh # # chkconfig: 2345 11 89 # # description: Loads the rc.firewall-2.2 ruleset. # # processname: firewall-2.2 # pidfile: /var/run/firewall.pid # config: /etc/rc.d/rc.firewall-2.2 # probe: true # ---------------------------------------------------------------------------- # v08/29/02 # # Part of the copyrighted and trademarked TrinityOS document. # http://www.ecst.csuchico.edu/~dranch # # Written and Maintained by David A. Ranch # dranch@trinnet.net # # Updates # ------- # # ---------------------------------------------------------------------------- # Source function library. . /etc/rc.d/init.d/functions # Check that networking is up. # This line no longer work with bash2 #[ ${NETWORKING} = "no" ] && exit 0 # This should be OK. [ "XXXX${NETWORKING}" = "XXXXno" ] && exit 0 [ -x /sbin/ifconfig ] || exit 0 # The location of various iptables and other shell programs # # If your Linux distribution came with a copy of iptables, most # likely it is located in /sbin. If you manually compiled # iptables, the default location is in /usr/local/sbin # # ** Please use the "whereis iptables" command to figure out # ** where your copy is and change the path below to reflect # ** your setup # IPCHAINS=/sbin/ipchains # See how we were called. case "$1" in start) /etc/rc.d/rc.firewall-2.2 ;; stop) echo -e "\nFlushing firewall and setting default policies to REJECT\n" $IPCHAINS -P input REJECT $IPCHAINS -P output REJECT $IPCHAINS -P forward REJECT $IPCHAINS -F input $IPCHAINS -F output $IPCHAINS -F forward ;; restart) $0 stop $0 start ;; status) $IPCHAINS -L ;; mlist) $IPCHAINS -M -L ;; *) echo "Usage: firewall-2.2 {start|stop|status|mlist}" exit 1 esac exit 0 echo -e "\nDone.\n"