#!/bin/sh
#
# This script is called when the PPP interface is brought down.
# The script terminates the running argus process.
#
# Author: Yotam Rubin <yotam@makif.omer.k12.il>
# Date: Mon, 12 Nov 2001 20:46:10 +0200

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

test -f $DEFAULTS || exit 1

. $DEFAULTS

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

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

kill `cat $PIDFILE` > /dev/null 2>&1 
rm -f "$PIDFILE"

exit 0
