Hal Burgiss wrote:
On Fri, Feb 13, 2004 at 02:01:04PM +0000, Coume - Lubox.com wrote:Guys - I think you are missing an easier solution.
Sure, write a script that checks for connection, and restarts whateverCould you explain a bit more? Because I do not know how to do what
you want it to.
you told me... :(
Correct me if I am wrong, but I think the problem you are solving is this:
There is an ethernet connection to an ISP, and all you want to do is run a script to restart services whenever that interface is brought up.
If that is the case just make a script /sbin/ifup-local that checks whether the sole argument is the interface you care about, and if so, performs the restarts.
Actually I like to put the ifup-local script in /etc/sysconfig/network-scripts and add a symbolic link to it from /sbin/ifup-local. That way I can keep my script in the same location as the interface configurations.
Here is a sample script I used to set system time whenever an on-demand ppp0 interface was started:
---------------------------------------------------------------
#!/bin/bash
#Invoked from ifup-post via /sbin/ifup-local ${DEVICE}
#The installer must add a symbolic link from /sbin/ifup-local to this script
if [ $1 = "ppp0" ] ; then
ntpdate=`ntpdate tock.usno.navy.mil 2>&1`
ntprc=$?
logger "ifup-local: $ntpdate"
if [ $ntprc -eq 0 ] ; then
clock -w
logger "ifup-local: clock -w performed"
fi
fi
---------------------------------------------------------------
-- ----------------------------------------------------------- "Spend less! Do more! Go Open Source..." -- Dirigo.net Chris Johnson, RHCE #807000448202021