]> git.pld-linux.org Git - packages/portsentry.git/commitdiff
- cleaning
authorankry <ankry@pld-linux.org>
Wed, 7 May 2003 23:35:21 +0000 (23:35 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    portsentry.init -> 1.3

portsentry.init

index d723689d833c20d1856398c73eea94defcb2add2..3811a9ca633c2bff53b7196018bf90a76cb24eed 100644 (file)
@@ -1,14 +1,14 @@
 #! /bin/sh
 #
-# portsenry         Start the portsentry Port Scan Detector
+# portsenry    Start the portsentry Port Scan Detector
 #
-# chkconfig: 345 98 05
-# description: Portsentry Port Scan Detector is part of the Abacus Project \
-#              suite of tools. The Abacus Project is an initiative to release \
-#              low-maintenance, generic, and reliable host based intrusion \
-#              detection software to the Internet community.
-# processname: portsentry
-# pidfile: /var/run/portsentry.pid
+# chkconfig:   345 98 05
+# description: Portsentry Port Scan Detector is part of the Abacus Project \
+#              suite of tools. The Abacus Project is an initiative to release \
+#              low-maintenance, generic, and reliable host based intrusion \
+#              detection software to the Internet community.
+# processname: portsentry
+# pidfile:     /var/run/portsentry.pid
 
 
 # Source function library
 [ -f /etc/sysconfig/portsentry ] && . /etc/sysconfig/portsentry
 
 # Check that networking is up.
-if [ "${NETWORKING}" = "no" ]; then
-       echo "WARNING: Networking is down. Portsentry service can't be runed."
-       exit 1
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down Portsentry
+               exit 1
+       fi
+else
+       exit 0
 fi
 
 [ -f /usr/bin/portsentry ] || exit 0
@@ -31,47 +35,48 @@ fi
 # Check the modes we're running in...
 unset allmodes;
 is_yes "$PORTSENTRY_ATCP"; [ "$?" = 1 ] || {
-    PORTSENTRY_TCP="0";
-    PORTSENTRY_STCP="0";
-    allmodes=" -atcp";
-    }
+       PORTSENTRY_TCP="0";
+       PORTSENTRY_STCP="0";
+       allmodes=" -atcp";
+}
 is_yes "$PORTSENTRY_AUDP"; [ "$?" = 1 ] || {
-    PORTSENTRY_UDP="0";
-    PORTSENTRY_SUDP="0";
-    allmodes="$allmodes -audp";
-    }
+       PORTSENTRY_UDP="0";
+       PORTSENTRY_SUDP="0";
+       allmodes="$allmodes -audp";
+}
 is_yes $PORTSENTRY_TCP; [ "$?" = 1 ] || allmodes="$allmodes -tcp";
 is_yes $PORTSENTRY_UDP; [ "$?" = 1 ] || allmodes="$allmodes -udp";
 is_yes $PORTSENTRY_STCP; [ "$?" = 1 ] || allmodes="$allmodes -stcp";
 is_yes $PORTSENTRY_SUDP; [ "$?" = 1 ] || allmodes="$allmodes -sudp";
 
+
 case "$1" in
   start)
        # Check if the service is already running?
        for mode in $allmodes; do
-           if [ ! -f /var/lock/subsys/portsentry$mode ]; then
-               msg_starting "portsentry$mode"
-               daemon "portsentry $mode"
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/portsentry$mode
-           else
-               msg_Already_Running portsentry
-               exit 1
-           fi
-           done
+               if [ ! -f /var/lock/subsys/portsentry$mode ]; then
+                       msg_starting "portsentry$mode"
+                       daemon "portsentry $mode"
+                       RETVAL=$?
+                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/portsentry$mode
+               else
+                       msg_already_running portsentry
+                       exit 1
+               fi
+       done
        ;;
 
   stop)
-        # Stop daemons.
+       # Stop daemons.
        cd /var/lock/subsys/;
        ls --color=none /var/lock/subsys/portsentry* >/dev/null 2>&1
        [ $? -eq "0" ] || {
-           msg_Not_Running portsentry
-           exit 1
-           }
+               msg_not_running portsentry
+               exit 1
+       }
        msg_stopping portsentry
-        killproc portsentry
-        rm -f /var/lock/subsys/portsentry* >/dev/null 2>&1     
+       killproc portsentry
+       rm -f /var/lock/subsys/portsentry* >/dev/null 2>&1      
        rm -f /var/run/portsentry.pid /var/run/portsentry.loc* >/dev/null 2>&1
        ;;
   status)
@@ -82,8 +87,8 @@ case "$1" in
        $0 start
        ;;
   *)
-       msg_usage "$0 {start|stop|status|restart|reload}"
+       msg_usage "$0 {start|stop|restart|reload|status}"
        exit 1
 esac
 
-exit 0
+exit $RETVAL
This page took 0.278693 seconds and 4 git commands to generate.