Using custom variable to assign value to bootfile-name

Glenn Satchell glenn.satchell at uniq.com.au
Wed Nov 18 00:38:08 UTC 2015


Hi Karteek

man dhcp-eval will give you all the boolean, arithmetic and string
functions. There is substring(), but there does not appear to be a
length() function.

regards,
-glenn

On Wed, November 18, 2015 5:20 am, karteek.challa at wipro.com wrote:
> Hi Niall and Simon,
>
> Thanks a ton for your inputs.
> I have created the config files with only entry with the software version
> for each target and included them in the actual dhcp file. And gave full
> permission to these config files and only r&x permission to actual dhcp
> file.
>
> I have one more query!
> How can I calculate the string length in the dhcp file.
> For example:
> Option software-version "soft_v1_g2333.tar"
> I want to know the length of "soft_v1_g2333.tar" in the dhcp conf file.
> Is it possible? Is there any function similar to substring()?
>
>
> BR,
> Karteek
>
>
> -----Original Message-----
> From: dhcp-users-bounces at lists.isc.org
> [mailto:dhcp-users-bounces at lists.isc.org] On Behalf Of Simon Hobson
> Sent: den 11 november 2015 23:43
> To: Users of ISC DHCP
> Subject: Re: Using custom variable to assign value to bootfile-name
>
> Niall O'Reilly <niall.oreilly at ucd.ie> wrote:
>
>>  Variables don't do what you need.
>>
>>  I'ld suggest something like this, repeated for the other groups:
>>
>> group target_1 {
>>  option boot-filename = "soft_1.tar";
>> }
>
> I think the problem he has is that if he allows the devs to edit that
> themselves, they screw up the rest of the config. I'm wondering if some
> include files (and perhaps some scripts) might work.
>
> group target_1 {
>  $INCLUDE soft1.cfg
> }
>
> Then generate a number of config files that you can use with the include
> statements. Either let the devs edit them directly, or let them work
> through a script that does some sanity checking.
>
> Or put placeholders in the config, and have a script that replaces them
> with the desired values to generate a config file for the server to use.
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments. WARNING: Computer viruses can
> be transmitted via email. The recipient should check this email and any
> attachments for the presence of viruses. The company accepts no liability
> for any damage caused by any virus transmitted by this email.
> www.wipro.com
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>




More information about the dhcp-users mailing list