On 3/12/07, Carlo Calica <[EMAIL PROTECTED]> wrote:
> I've given some more thought this.  I'd like to add some pre/post
> hooks to the ifup/ifdown actions.  These hooks would be scripts called
> /S/S/NetScripts/<iface>-{pre,post}{up,down}.  Each would be sourced by
> the Network task.  The pre hooks could override vars set in
> NetworkOptions (ie allowing the user to search for a preferred ESSID).
>
> Thoughts?

This configuration reminds me of the old scheme we had to configure
networking: there was a directory named /System/Settings/Network (or
something like this), with plain text files inside named lo, eth0,
eth1, and so on. I don't recall exactly their contents, but it was
something like this:

ipaddr=10.0.202.21
netmask=255.255.254.0
default_gateway=10.0.202.1

I don't like too much to have more config files spread over
/System/Settings. What about moving everything to these files (again),
writing simple pre/post tasks as functions inside them? Another option
is to enhance NetworkOptions like this:

eth0_pre_hook() {
    echo "hi"
}
eth0_post_hook() {
    echo "bye"
}
eth0_IP=10.0.202.21
...

The bootscripts then just need to source that file, and try to blindly
execute these functions (Quiet ${interface}_{pre,post}_hook). I'm
doing something similar today in Bootstrap:

    # If a hook is configured for the current package, execute it
    # so that a specific version can be used. Hooks are declared
    # inside functions/PkgFunctions.
    hook_function="`echo ${pkg_name} | sed 's/+//g' | sed 's/-/_/g'`_hook"
    pkg_version=`${hook_function} 2> /dev/null`

Works pretty well.

> PS.  Anyone try my updated Network and WirelessConfig tasks?

No, I'm still a wired man (I hope to change this status this month).

-- 
Lucas
powered by /dev/dsp
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to