[Dnsmasq-discuss] Feature Request: tftp-script

Simon Kelley simon at thekelleys.org.uk
Mon Mar 26 21:36:25 BST 2012


On 25/03/12 17:02, Shantanu Gadgil wrote:
> Hi,
> 
> What I was suggesting in my previous post was ...
> 
> lets consider the following as a possible scenario ...
> --- snip ---
> tftp-script=/path/to/mytftpscript
> dhcp-script=/path/to/mydhcpscript
> dhcp6-script=/path/to/mydhcp6script
> dns-script=/path/to/dnsscript
> dns6-script=/path/to/dns6script
> --- snip ---
> 
> [root at server ~]# ls -l /path/to/mytftpscript
> lrwxrwxrwx.   1 root root           3 Mar 21 00:20 /path/to/mytftpscript -> mycommonscript
> [root at server ~]# ls -l /path/to/mydhcpscript
> lrwxrwxrwx.   1 root root           3 Mar 21 00:20 /path/to/mydhcpscript -> mycommonscript
> [root at server ~]# ls -l /path/to/mydhcp6script
> lrwxrwxrwx.   1 root root           3 Mar 21 00:20 /path/to/mydhcp6script -> mycommonscript
> 
> ... and so on ...
> 
> The "mycommonscript" should have the necessary logic to decide which "script" is actually being called based of the value of "$0" (argv[0] in C speak) (the actual filename)
> 
> Keeping it this way would allow you to separate the "$1" value for the various possibilities, and not have to worry about script breakage during adding more parameters.
> It becomes the script-writer's headache to cater/handle parameters as they appear (!)
> 
> The very attractive part here is that the user has to maintain only a single script.
> 

That's attractive, except that it increases the already vast number of
configuration options in dnsmasq, and it doesn't work correspondingly on
the Lua side, where there can be only one Lua script file, but functions
for each  (dhcp, tftp, dhcp6, etc etc)

I think the way to go is to call dhcp-script with $1 as "tftp"


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list