As a script writer I can confirm that a well written script should not break if a new "first" parameter in added; in place of 'add', 'del' and 'old'
Any code, script or otherwise, should basically follow the same "modular" philosophy. Wrt the actual thought, I have been sitting on this idea for quite some time, not sure how to nicely (correctly) minimize the TFTP script invocations. I do think that some intelligence can be added to dnsamsq itself to trigger the TFTP script upon actual file delivery to client (before file send, after file send, etc, hooks), rather than any-tftp-request. Not having used the dhcp-script too much myself, I won't be able to immediately create a mental picture whether mixing TFTP and DHCP in the same script would be any problem at all. Thanks for the positive response on the idea though, Regards, Shantanu --- On Mon, 3/19/12, Simon Kelley <si...@thekelleys.org.uk> wrote: > From: Simon Kelley <si...@thekelleys.org.uk> > Subject: Re: [Dnsmasq-discuss] Feature Request: tftp-script > To: dnsmasq-discuss@lists.thekelleys.org.uk > Date: Monday, March 19, 2012, 4:48 PM > On 18/03/12 07:09, Shantanu Gadgil > wrote: > > Hi, > > > > I was wondering whether it would be possible to have > hooks for the TFTP operations, just like the DHCP > operations. > > > > This is just a rough thought for now ... > > When a TFTP request is made from the client (or is > successful when the file is /actually/ provided), I want to > be able to log the IP adress (or maybe send a mail) to > collect some data as to how many network based installations > actually started, etc. > > > > If it could be possible to have the filename as one of > the parameters in the hook, it would be even better, as then > I can isolate actual installations that started, as opposed > to TFTP requests which just loading the PXE menu. > > > > Regards, > > Shantanu > > That sounds to me like a very sensible suggestion. > > There are two obvious ways to do it: either add an extra > hook (--tftp-script), or add an extra possible "action" > value to the current --dhcp-script. I think the later is how > I'd do it if starting from scratch, but it has the > disadvantage of possibly breaking existing script code. On > the other hand, any sane script should just ignore > unrecognised actions; the example code supplied with dnsmasq > does. > > Any script users out there, please check your code, would > adding another value to {add, old, del, init} break stuff? > > > > Cheers, > > Simon. > > _______________________________________________ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss