#!/bin/sh
#
# This script is called when ppp connects to the network.
# The script calls argus to listen to the current ppp interface.
#
# Original Author: Yotam Rubin <yotam@makif.omer.k12.il>
# Date: Tue,  3 Jul 2001 20:47:11 +0300

CONFIG=/etc/argus.conf
ARGUS=/usr/sbin/argus
DEFAULTS=/etc/default/argus-server
LOGFILE=/var/log/argus/argus.log
PIDFILE=/var/run/argus.$PPP_IFACE

test -f $DEFAULTS || exit 1

. $DEFAULTS

# Check whether this should should be started.
if [ "$STARTUP" = "boot" ] || [ "$STARTUP" = "none" ]; then
    exit 1
fi

test -f $CONFIG || exit 1
test -f $ARGUS  || exit 1 

if [ ! -f $PIDFILE ]; then
    $ARGUS -F $CONFIG -i $PPP_IFACE -w $LOGFILE -n $PIDFILE -d
    exit 0
fi

exit 1

