I recently discovered that if you have a script located at /etc/ppp/ip-up then it will get called every time a PPP connection is started. Similarly, if you have a script at /etc/ppp/ip-down then it will get called every time the connection goes down. It is important that the execute bit is set on the script, and you proabably have to be root to create and save the file. Here's how to set the execute bits on the two scripts:
chmod a+x ip-upI use it to start and stop fetchmail (pop-smtp mailing software). But by using 'open', you could probably do anything. A word of caution: It may be running stuff as root so a sudo username whatevercommands might be useful.
chmod a+x ip-down
Mac OS X Hints