#!/bin/sh
# /etc/ppp/auth-up
#
#  Called when a remote system authenticates. Default implementation logs but
#  takes no action. By providing an executable file /etc/ppp/auth-up.local
#  (or by making it a directory containing executable files) scripts can be
#  added.
#
#  Argument summary:
#    interface-name peer-name user-name tty-device speed
#
#  See pppd(8) for full details on how this script is run and used.
#

logger -t pppd "ppp/$1: peer $2 (user $3) just authenticated on $4, $5 baud"

LOCAL="/etc/ppp/auth-up.local"
if [ -d "${LOCAL}" ]
then
	for SCRIPT in "${LOCAL}"/*
	do
		[ -x "${SCRIPT}" ] || continue
		${SCRIPT} "$@"
	done
elif [ -x "${LOCAL}" ]
then
	${LOCAL} "$@"
fi
