wok diff ntop/stuff/etc/init.d/ntop @ rev 10355

libIDL: Update WGET_URL to use GNOME_MIRROR in tazwok.conf and cook.conf.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 22 16:49:53 2011 +0000 (2011-05-22)
parents
children ef7ffda1c22c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ntop/stuff/etc/init.d/ntop	Sun May 22 16:49:53 2011 +0000
     1.3 @@ -0,0 +1,62 @@
     1.4 +#!/bin/sh
     1.5 +# /etc/init.d/ntop : Start, stop and restart ntop daemon on SliTaz, at 
     1.6 +# boot time or with the command line.
     1.7 +#
     1.8 +# To start SSH server at boot time, just put ntop in the $RUN_DAEMONS
     1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    1.10 +#
    1.11 +. /etc/init.d/rc.functions
    1.12 +
    1.13 +
    1.14 +NAME=ntop
    1.15 +DESC="ntop server"
    1.16 +DAEMON=/usr/bin/ntop
    1.17 +
    1.18 +HTTP_PORT="3000"
    1.19 +
    1.20 +OPTIONS="-w HTTP_PORT -d"
    1.21 +PIDFILE=/var/run/ntop.pid
    1.22 +
    1.23 +case "$1" in
    1.24 +  start)
    1.25 +    if [ -f $PIDFILE ] ; then
    1.26 +      echo "$NAME already running."
    1.27 +      exit 1
    1.28 +    fi
    1.29 +    # We need to set ntop admin password.
    1.30 +    if [ ! -f /var/ntop/ntop_pw.db ] ; then
    1.31 +		ntop -A || exit
    1.32 +    fi
    1.33 +    echo -n "Starting $DESC: $NAME... "
    1.34 +    $DAEMON $OPTIONS
    1.35 +    status
    1.36 +    ;;
    1.37 +  stop)
    1.38 +    if [ ! -f $PIDFILE ] ; then
    1.39 +      echo "$NAME is not running."
    1.40 +      exit 1
    1.41 +    fi
    1.42 +    echo -n "Stopping $DESC: $NAME... "
    1.43 +    kill `cat $PIDFILE` && rm -f $PIDFILE
    1.44 +    status
    1.45 +    ;;
    1.46 +  restart)
    1.47 +    if [ ! -f $PIDFILE ] ; then
    1.48 +      echo "$NAME is not running."
    1.49 +      exit 1
    1.50 +    fi
    1.51 +    echo -n "Restarting $DESC: $NAME... "
    1.52 +    kill `cat $PIDFILE` && rm -f $PIDFILE
    1.53 +    sleep 2
    1.54 +    $DAEMON $OPTIONS
    1.55 +    status
    1.56 +    ;;
    1.57 +  *)
    1.58 +    echo ""
    1.59 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.60 +    echo ""
    1.61 +    exit 1
    1.62 +    ;;
    1.63 +esac
    1.64 +
    1.65 +exit 0