#!/bin/sh

#=============================================================================
#
# This script runs when a PPP interface comes up.
#
# We don't want to restart the firewall when a PPTP VPN user appears!
# So... we have to do some automagic to detect whether this is the external 
# PPPoE connection.
#
#=============================================================================

logger -p local6.notice -t firewall "detected new connection on $1"

TYPE=`echo $1 | sed 's/[0-9].*//'`

if [ -e "/etc/sysconfig/network-scripts/ifcfg-$1" ]; then
    logger -p local6.notice -t firewall "detected connection type - PPPoE DSL"
    /sbin/service firewall restart
    [ -x /usr/sbin/dnsupdate ] && /usr/sbin/dnsupdate
elif [ "$TYPE" == "pptp" ]; then
    logger -p local6.notice -t firewall "detected connection type - PPTP VPN"
fi
