On Mon, Oct 31, 2005 at 12:41:51PM +0100, Hermann Lauer wrote: > Hello, > > > On Wed, Oct 05, 2005 at 02:25:29PM +1000, Andrew Pollock wrote: > > > > So my setup works with this hack, but a bash expert would probably know > > > a better solution. > > > > > > > So, how does this sound...? > > > > If run_hook() is called with the name of the script and then all the > > arguments (i.e. $*) that dhclient-script was called with, then run_hook() > > has access to all the arguments. Simply shifting once will throw away the > > name of the hook, and make $1 the first argument that dhclient-script was > > called with. > > Sound like a good solution to me.
Cool! > > > > If you could please substitute your doctored dhclient-script with what's at > > http://people.debian.org/~apollock/dhcp3/dhclient-script and let me know if > > I'm on the right track or not, that'd be great. > > run_hook() and run_hookdir() looks okay for me, but the following change looks > wrong to me: > > @@ -64,14 +67,15 @@ > # Must be used on exit. Invokes the local dhcp client exit hooks, if any. > exit_with_hooks() { > exit_status=$1 > + shift # See run_hooks() > > # Source the documented exit-hook script, if it exists > > because you are shifting away the number which makes the difference. > Will test this and let you know the results. Yes, but $exit_status is purely saved for exiting with the correct exit code after running all the hooks, right? If the hooks are supposed to have access to the exit code as well, then I guess I can either not shift it off $*, or the hooks can access it via $exit_status. Actually, after I reread the bug report, you're probably right, I don't want to be discarding the original $1 before running the hooks, it's the crux of your original bug report... > Sorry for not responding first - have been to busy and then forget about your > response. No worries, but please do get back to me. I'm eager to close off as many of these bugs as possible (especially the older ones). regards Andrew -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]