I hope this script isn't as useless as my previous one. :D

/etc/conf.d/ntop
--------------------
#!/bin/bash

USER="nobody"

NTOP_OPTS=" -u $USER"
-------------------

/etc/rc.d/ntop
-------------------
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/ntop

PID=`cat /var/run/ntop.pid 2>/dev/null`
case "$1" in
  start)
    stat_busy "Starting ntop"
    /usr/bin/ntop $NTOP_OPTS > /dev/null 2>&1 &
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon ntop
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping ntop"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon ntop
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0
-------------------

It takes a while before ntop is stopped completely after running
"/etc/rc.d/ntop stop" but eventually it exits nicely.


Good night


FUBAR

_______________________________________________
arch mailing list
[email protected]
http://archlinux.org/mailman/listinfo/arch

Reply via email to