#!/bin/sh
# /etc/ppp/ip-up
#
# started by pppd when the link comes up
#
# Purpose : 
# Master starter for modulized services


# A small helper function, so the loging will work, export the parameters,
# ./ip-up was called with, so ./service/locknlog can read them out 
export INTERFACE=$1
export TTYDEV=$2
export SPEED=$3
export LOCAL-IP=$4
export REMOTE-IP=$5

#
# This is inspired by the way, SuSE handles the runlevel scripts :
# dive in 
#
# /etc/ppp/service/start
#
# And execute anything, found in there. This makes it very easy, to add
# a new service, just write the (service)script, put it in 
# /etc/ppp/service and then make a link pointing to it in /etc/ppp/service/start
# (and of course also in /etc/ppp/service/stop, unless the service is 
# executed on startup only ;) ).
#
# Each link starts with a two digit number (I hope, no one will ever
# want to run more then 99 services), this way, services are started 
# in a sorted way (lower numbers first)
#
# IMPORTANT : For security reasons, always use absolute links and 
# always use absolute pathnames. Otherwise a normal user could get
# root access, if you let him/her establish the link using sudo !
# Also be carefull with what you link in /etc/ppp/service/start and 
# /etc/ppp/service/stop make sure it doesn't have any unwanted site 
# effects !

for SCRIPT in /etc/ppp/service/start/*; do 
  $SCRIPT start
done 