[Dnsmasq-discuss] Feature Request: tftp-script
Shantanu Gadgil
shantanugadgil at yahoo.com
Wed Mar 21 07:24:09 GMT 2012
Hi,
I think it would be OK to add different "--*-script" commands. So you can have 'dhcp6-script', 'tftp-script' ... possibly 'dns-script', etc, etc.
I know that I would like to have a single script to deal with each of these, and that IS how I would do it.
The way I would do (and usually is done) is that /each/ of the --*-script command would point to a *different* file; each of which is a symlink to the same "real" file!
The "real" script should look at '$0' and figure out which "action" is triggering self and take appropriate action.
Regards,
Shantanu
--- On Tue, 3/20/12, Simon Kelley <simon at thekelleys.org.uk> wrote:
> From: Simon Kelley <simon at thekelleys.org.uk>
> Subject: Re: [Dnsmasq-discuss] Feature Request: tftp-script
> To: "richardvoigt at gmail.com" <richardvoigt at gmail.com>
> Cc: dnsmasq-discuss at lists.thekelleys.org.uk
> Date: Tuesday, March 20, 2012, 5:14 PM
> On 19/03/12 17:51, richardvoigt at gmail.com
> wrote:
> > Existing scripts could definitely break, imagine one
> that just logs
> > certain environment variables plus the parameter.
> The new action values
> > won't have the right environment variable set.
>
> A good point, but such scripts are already going to suffer
> as soon as DHCPv6 is used: that has the same action values,
> but some environment variables change.
>
> Adding --tftp-script will work this time, but it will have
> to be repeated with more --*-script options if we ever add
> more functions. That starts to get silly. Biting the bullet
> now, and documenting that the script has to ignore unknown
> actions, fixes the problem once and for all.
>
> Of course, that should have been the case from the start,
> but it's too late now. Dnsmasq's record on backwards
> compatibility is pretty good, so maybe we're entitled to a
> bit of slack.
>
> >
> > How about both? Give the --tftp-script the same
> action parameter, and
> > keep actions unique, that way both options can be
> pointed to the same
> > script, or separate scripts.
> >
>
> If --tftp-script is used, that's the way to go, for sure.
>
> Cheers,
>
> Simon.
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list