#!/bin/bash

. /etc/sysconfig/ntop

if  [  -f  /etc/network/interfaces  ] ; then
  for i in $(grep "^iface" /etc/network/interfaces | awk '{print $2}') ; do
    [ "$i" = "lo" -a "$IGNORE_LO" = "yes" ] && continue
    IFACES="${IFACES},$i"
  done
  IFACES="${IFACES#,}"    # Remove comma from beginning of list
fi

PROGRAM=/usr/bin/ntop
NAME="ntop (using following interfaces: ${IFACES}"
ARGS="-d -u ntop -w $HTTP_PORT -W $HTTPS_PORT ${W3C} \
          --use-syslog=daemon -i ${IFACES} ${INTERFACE_MERGE}"
RUNLEVEL=3
NEEDS="+network +remote_fs"

. /etc/init.d/smgl_init

start() {
  echo "Starting ntop (tracking interfaces: ${IFACES}..."
  loadproc $PROGRAM $ARGS
}
