Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 7bbffe0d64040b101008b517ea614e3c > files > 2

ntop-3.1-1mdk.src.rpm

#!/bin/sh
#
# chkconfig: 2345 93 83
#
# description: This shell script takes care of starting and stopping ntop.
# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

prog="/usr/sbin/ntop"
name=ntop

# Allow extra arg
. /etc/sysconfig/${name}

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

! [ -x $prog ] && echo $prog not found, aborting && exit 1


start () {
  # start daemon
  echo -n $"Starting $name: "
#NOTE:  You most likely will have to fix this up to reflect your network.
#       Do not run ntop until you have read the docs/1STRUN.txt file to set
#       the admin password!
  daemon $prog -d -P /var/lib/ntop -u ntop $extra_arg
  RETVAL=$?
  echo
  [ $RETVAL = 0 ] && touch /var/lock/subsys/ntop
  return $RETVAL
}

stop () {
  # stop daemon
  echo -n $"Stopping $name: "
  killproc ntop
  RETVAL=$?
  echo 
  [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ntop
  return $RETVAL
}

restart () {
  stop
  start
}

case "$1" in
  start)
    start
  ;;

  stop)
    stop
  ;;

  restart)
    restart
  ;;

  condrestart)
    [ -f /var/lock/subsys/ntop ] && restart || :
  ;;

  status)
    status ntop 
  ;;
  *)
    echo $"Usage: $0 {start|stop|restart|condrestart|status}"
    exit 1
esac

exit $RETVAL