File: //etc/rc1.d/K92ip6tables-retry
#!/bin/sh
#
# ip6tables-retry Try to start ip6tables if it previously failed.
#
# chkconfig: 2345 14 92
# description: ip6tables-retry is a complete hack to try and restart ip6tables if
#
### BEGIN INIT INFO
# Provides: ip6tables-retry
# Required-Start: $network $ip6tables
# Required-Stop:
# Should-Start: $named $dnsmasq
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Try to restart ip6tables firewall on error.
# Description: ip6tables-retry is a complete hack to try and restart ip6tables 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/ip6tables_retry ]; then
/sbin/service ip6tables start
RETVAL=$?
/bin/rm /tmp/ip6tables_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: ip6tables-retry {start|stop|restart|status}"
RETVAL=2
;;
esac
exit $RETVAL