[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How-to modify /etc/init.d/networking for stopping IPTables?



Hi,
	Currently I'm using the networking rc script to run my IPTables script. 

I would like to know if there would be a way (by editing the networking rc 
file) to clear all chains and then remove all iptables modules once 
networking has been halted by issuing /etc/init.d/networking stop?

Also, this is how I run my IPtables script:

ip_tables () {
    if [ -e /sbin/iptables ] ; then
    echo -n "Initiating IPtables: "
	sh /etc/network/ip_tables
    echo "done."
    fi
}

Would there be a way where I can verify if both the iptables executable and 
script are both existent, and if not, have the rc script print to the 
terminal something like:

"failed."
"IPTables was not loaded properly"

Please forgive my poor knowledge of bash scripting. I have never taken any 
technical trainning. My only resource for Debian and bash scripting are these 
lists and the scripts on my hard drive :D

Thanks,

Stef



Reply to: