]> git.pld-linux.org Git - packages/ntop.git/blobdiff - ntop.init
- 4.0.1
[packages/ntop.git] / ntop.init
index 08da0adb1937436d1b7bca56fe084f9107994789..073fcd040cf61335b8e6c8635919ad439b27825c 100644 (file)
--- a/ntop.init
+++ b/ntop.init
@@ -26,24 +26,26 @@ else
        exit 0
 fi
 
+if [ -z "$NTOP_DIR" ]; then
+       nls "NTOP_DIR not set in /etc/sysconfig/ntop"
+       exit 6
+fi
+
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
        # Check if ntop is initialized
-       if [ ! -f "$NTOP_DIR/addressQueue.db" ]; then
-               nls "ntop is not initialized. Try \"%s init\" before start." "$0"
-               echo ""
-               nls "after setting password please ^C, to stop the daemon"
+       if [ ! -f "$NTOP_DIR/ntop_pw.db" ]; then
+               nls "ntop is not initialized. Try '%s init' before start." /etc/rc.d/init.d/ntop
                exit 6
        fi
 
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/ntop ]; then
                msg_starting ntop
-               ntop -d -P $NTOP_DIR > /dev/null 2>&1
+               daemon --redirdfs /usr/sbin/ntop @/etc/ntop.conf -d -P $NTOP_DIR
                RETVAL=$?
-               [ $RETVAL -eq 0 ] && ok || fail
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntop
        else
                msg_already_running ntop
@@ -57,7 +59,7 @@ case "$1" in
                rm -f /var/lock/subsys/ntop >/dev/null 2>&1
        else
                msg_not_running ntop
-       fi      
+       fi
        ;;
   restart)
        $0 stop
@@ -74,7 +76,7 @@ case "$1" in
        fi
        ;;
   init)
-       ntop -P $NTOP_DIR
+       ntop -P $NTOP_DIR @/etc/ntop.conf -A
        ;;
   status)
        status ntop
This page took 0.030093 seconds and 4 git commands to generate.