> Steve Edwards <[email protected]> writes:
>
>> atftpd can do PCRE substitutions to transform a requested file name 
>> into something else. I've not used this facility, but I'm guessing you 
>> could transform:
>>
>>      SIPDefault.cnf -> cisco/SIPDefault.cnf
>>      sip.cfg -> polycom/sip.cfg
>>      spa841.cfg -> sipura/spa841.cfg
>
On Fri, 23 Oct 2009, Benny Amorsen wrote:

> Cute, but all that accomplishes is renaming. I want to run a script 
> which returns a different configuration based on the file name (and 
> possibly the client IP address). Unfortunately there is also no 
> UserAgent-header in TFTP...

So, break out your H&S or your wallet :)

How about adding an option to atftpd to enable "check the execute bit" on 
the requested file. If the file has the execute bit, set the MAC, IP 
Address, etc. as environment variables, exec the file, and return the 
output to the requester?

Then, you could write (for example) spa841.cfg as a shell script which 
have access to the MAC, etc. and could run sed/replace/preprocessor/m4 and 
create the "file" on the fly.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       [email protected]      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to