Update of /cvsroot/devil-linux/build/scripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv475/scripts/scripts
Added Files:
Tag: rel-1-2-patches
ntop
Log Message:
fixed ntop (Roland Pabel)
--- NEW FILE: ntop ---
#!/bin/bash
#
# $Source: /cvsroot/devil-linux/build/scripts/scripts/ntop,v $
# $Revision: 1.1.2.1 $
# $Date: 2004/09/16 13:37:48 $
#
# http://www.devil-linux.org
#
### BEGIN INIT INFO
# Provides: ntop
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Description: starts the ntop daemon
### END INIT INFO
# settings
test -s /etc/sysconfig/config && . /etc/sysconfig/config
test -s /etc/sysconfig/network/config && . /etc/sysconfig/network/config
# parameters
NAME="ntop"
CONFIGNAME=NTOP
DAEMON=/usr/bin/ntop
PARAMETER="-d -L -P /var/lib/ntop -u ntop"
# source function library
source /etc/init.d/functions
eval START=\$START_$CONFIGNAME
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test $link = $base && START=yes
test "$START" = "yes" || exit 0
if [ ! -e $DAEMON ]; then
echo
echo "$DAEMON not found. Did you install the package?"
exit 1
fi
case "$1" in
start)
if [ ! -f /var/lib/ntop/ntop_pw.db ]; then
$WARNING
echo -n "Warning :"
$NORMAL
echo " Run \"$DAEMON $PARAMETER --set-admin-password=<password>\" before first start."
exit 1
fi
PARAMETER="$PARAMETER -i $NTOP_INTERFACES"
if [ "$NTOP_PORT" != "" ]; then
PARAMETER="$PARAMETER -w $NTOP_PORT"
fi
if [ "$NTOP_SSL_PORT" != "" ]; then
PARAMETER="$PARAMETER -W $NTOP_SSL_PORT"
fi
echo -n "Starting $NAME: "
loadproc $DAEMON $PARAMETER
;;
stop)
echo -n "Shutting down $NAME: "
killproc $DAEMON
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
|