HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //etc/rc0.d/K92iptables-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