Listing 2: The ip-up script
#!/bin/sh
STATUSFILE=/etc/ppp/mirrorring
OVERRIDE=/etc/ppp/override.mirror
/bin/rm -f /tmp/ppp.log
echo "PPP log on `date`" >> /tmp/ppp.log
/etc/ns start net
if [ -f $STATUSFILE ]
then
if [ -f $OVERRIDE ]
then
echo "Mirrorring not allowed" >> /tmp/ppp.log
else
echo "Start mirrorring at `date`" >> /tmp/ppp.log
echo "Finished mirrorring at `date`" >> /tmp/ppp.log
fi
kill $PPID
else
wall << EOM
Internet connection established
EOM
fi
|