wok view ntop/stuff/etc/init.d/ntop @ rev 10250

Up: phpmyadmin to 3.4.1.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat May 21 02:40:09 2011 +0000 (2011-05-21)
parents
children ef7ffda1c22c
line source
1 #!/bin/sh
2 # /etc/init.d/ntop : Start, stop and restart ntop daemon on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start SSH server at boot time, just put ntop in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
11 NAME=ntop
12 DESC="ntop server"
13 DAEMON=/usr/bin/ntop
15 HTTP_PORT="3000"
17 OPTIONS="-w HTTP_PORT -d"
18 PIDFILE=/var/run/ntop.pid
20 case "$1" in
21 start)
22 if [ -f $PIDFILE ] ; then
23 echo "$NAME already running."
24 exit 1
25 fi
26 # We need to set ntop admin password.
27 if [ ! -f /var/ntop/ntop_pw.db ] ; then
28 ntop -A || exit
29 fi
30 echo -n "Starting $DESC: $NAME... "
31 $DAEMON $OPTIONS
32 status
33 ;;
34 stop)
35 if [ ! -f $PIDFILE ] ; then
36 echo "$NAME is not running."
37 exit 1
38 fi
39 echo -n "Stopping $DESC: $NAME... "
40 kill `cat $PIDFILE` && rm -f $PIDFILE
41 status
42 ;;
43 restart)
44 if [ ! -f $PIDFILE ] ; then
45 echo "$NAME is not running."
46 exit 1
47 fi
48 echo -n "Restarting $DESC: $NAME... "
49 kill `cat $PIDFILE` && rm -f $PIDFILE
50 sleep 2
51 $DAEMON $OPTIONS
52 status
53 ;;
54 *)
55 echo ""
56 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
57 echo ""
58 exit 1
59 ;;
60 esac
62 exit 0