Turn me on
--#--
A Unix computer's ppp connection is usually established by a script.
In the RedHat Linux distribution, a script called ifup-ppp runs
whenever the ppp interface is activated, whether through Linuxconf
or UserNet or some other tool.
We can take advantage of that and write a "wrapper" around ifup-ppp
that calls our new robot script at the same time. You could
edit ifup-ppp to make the call to the robot, but that's not
really necessary. Simply rename ifup-ppp something else, like
ifupppp, and write a new ifup-ppp that calls it:
#!/bin/sh
/etc/sysconfig/network-scripts/ifupppp $1
The $1 at the end of the business line simply passes on to the
original ifup-ppp the parameter passed to your wrapper script.
Then, on the next line, add a call to your robot:
#!/bin/sh
/etc/sysconfig/network-scripts/ifupppp $1
/home/webmaster/bin/domain_robot
And we are done! The next time you dial into your ISP account, your
robot will spring into action, notifying TSX, DSH or whoever (and all
the world, really) that your killer Web site is on the air!