home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110725.etc.tar.gz / bradford.20110725.etc.tar / etc / init.d / SuSEfirewall2_setup < prev    next >
Text File  |  2006-04-22  |  2KB  |  83 lines

  1. #! /bin/sh
  2. # Copyright (c) 2000-2002 SuSE GmbH Nuernberg, Germany.
  3. #
  4. # Author: Marc Heuse <marc@suse.de>
  5. #
  6. # /etc/init.d/SuSEfirewall2_setup
  7. #
  8. ### BEGIN INIT INFO
  9. # Provides: SuSEfirewall2_setup
  10. # Required-Start: SuSEfirewall2_init $network $local_fs
  11. # Should-Start: $ALL
  12. # Required-Stop: $local_fs
  13. # X-UnitedLinux-Should-Stop: 
  14. # Default-Start: 3 4 5
  15. # Default-Stop: 0 1 2 6
  16. # Short-Description: SuSEfirewall2 phase 2
  17. # Description: SuSEfirewall2_setup does some basic setup and is the
  18. #    phase 2 of 2 of the SuSEfirewall initialization.
  19. ### END INIT INFO
  20. # X-SuSE-Dep-Only
  21.  
  22. SUSEFWALL="/sbin/SuSEfirewall2"
  23. BOOTLOCKFILE="/var/lock/SuSEfirewall2.booting"
  24.  
  25. test -x $SUSEFWALL || exit 5
  26.  
  27. bootlinkisset()
  28. {
  29.     local l
  30.     l=`/sbin/runlevel | (read A B && echo $A)`
  31.     test -e /etc/init.d/rc$l.d/S??SuSEfirewall2_setup
  32. }
  33.  
  34. . /etc/rc.status
  35. rc_reset
  36.  
  37. case "$1" in
  38.     start)
  39.     echo -n "Starting Firewall Initialization "
  40.     echo -n '(phase 2 of 2) '
  41.     rm -f "$BOOTLOCKFILE"
  42.     $SUSEFWALL -q start
  43.     rc_status -v
  44.     ;;
  45.     stop)
  46.     echo -n "Shutting down the Firewall "
  47.     if [ -z "$REDIRECT" ]; then
  48.         $SUSEFWALL -q stop
  49.         rc_status -v
  50.     else
  51.         rc_status -s
  52.     fi
  53.     ;;
  54.     restart|force-reload)
  55.     $0 start
  56.     ;;
  57.     try-restart|reload)
  58.     if ($0 status) >/dev/null 2>&1; then
  59.         $0 start
  60.     else
  61.         rc_reset
  62.     fi
  63.     ;;
  64.     long-status)
  65.     echo "Checking the status of SuSEfirewall2 "
  66.     if ! $SUSEFWALL status; then
  67.         rc_failed 3
  68.     fi
  69.     ;;
  70.     status)
  71.     echo -n "Checking the status of SuSEfirewall2 "
  72.     iptables -nL reject_func >/dev/null 2>&1 || rc_failed 3
  73.     rc_status -v
  74.     ;;
  75.     *)
  76.     echo "Usage: $0 {start|stop|status|restart|reload|force-reload}"
  77.     exit 1
  78.     ;;
  79. esac
  80.  
  81. # Set exit status
  82. rc_exit
  83.