File: //etc/rc.d/rc2.d/S14iptables-retry
#!/bin/sh
#
# iptables-retry Try to start iptables if it previously failed.
#
# chkconfig: 2345 14 92
# description: iptables-retry is a complete hack to try and restart iptables if
#
### BEGIN INIT INFO
# Provides: iptables-retry
# Required-Start: $network $iptables
# Required-Stop:
# Should-Start: $named $dnsmasq
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Try to restart iptables firewall on error.
# Description: iptables-retry is a complete hack to try and restart iptables if
# it fails the first time.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# only usable for root
[ $EUID = 0 ] || exit 4
RETVAL=0
start() {
if [ -f /tmp/iptables_retry ]; then
/sbin/service iptables start
RETVAL=$?
/bin/rm /tmp/iptables_retry
fi
return $RETVAL
}
stop() {
return 0
}
restart() {
stop
start
}
status() {
return 1
}
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart|force-reload)
restart
RETVAL=$?
;;
status)
status
RETVAL=$?
;;
*)
echo $"Usage: iptables-retry {start|stop|restart|status}"
RETVAL=2
;;
esac
exit $RETVAL