[plug] Consulting

Richard Sharpe sharpe at ns.aus.com
Sat May 19 20:15:58 WST 2001


At 02:47 PM 5/18/01 +0800, Simon Scott wrote:
>
>	Have you got time to expand on this a little?

Well, I currently use /etc/ppp/ip-up.local to:

  install specific ipchains rules
  change my hostname to the correct one for the IP address I have been given
    (a little shell scripting does it)
  restart sendmail
  fix my /etc/resolv.conf
  restart fetchmail

What I wanted was something similar for when an ethernet interface comes up.

If you look at /sbin/ifup on RedHat, Mandrake or any RedHat derived distro,
you will see that it invokes /etc/sysconfig/network-scripts/ifup-post. The
last thing this last script does is invoke /sbin/ifup-local, if it exists
and is executable. (if [ -x /sbin/ifup-local ] ...)

It passes the device name to the script. So, if eth0 has come up,
/sbin/ifup-local will be called as:

  /sbin/ifup-local eth0

You can then do all sorts of magic in the script ...

>	I want to do something similar with my laptop


Regards
-------
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.ethereal.com)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba





More information about the plug mailing list