[Dnsmasq-discuss] Feature Request: tftp-script
simon at thekelleys.org.uk
Mon Mar 26 21:36:25 BST 2012
On 25/03/12 17:02, Shantanu Gadgil wrote:
> What I was suggesting in my previous post was ...
> lets consider the following as a possible scenario ...
> --- snip ---
> --- 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 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"
More information about the Dnsmasq-discuss