Something like that should work:

     foreach my $network ( keys %ConfigNetworks ) {
         # shorter, more convenient local accessor
         my %net = %{$ConfigNetworks{$network}};

         if ( $net{'dhcpd'} eq 'enabled' ) {
             my $domain = sprintf("%s.%s", $net{'type'}, 
$Config{general}{domain});
             delete $direct_subnets{"subnet $network netmask 
$net{'netmask'}"};

             %net = _assign_defaults(%net);
             my $next_server= '';
             $next_server = "next-server $net{'next_server'};" if 
(defined($net{'next_server'}));
             $tags{'networks'} .= <<"EOT";
subnet $network netmask $net{'netmask'} {
   option routers $net{'gateway'};
   option subnet-mask $net{'netmask'};
   option domain-name "$domain";
   option domain-name-servers $net{'dns'};
   range $net{'dhcp_start'} $net{'dhcp_end'};
   default-lease-time $net{'dhcp_default_lease_time'};
   max-lease-time $net{'dhcp_max_lease_time'};
   $next_server
}

EOT
         }


Le 2014-07-15 00:36, Chuck Glover a écrit :
> I start with editing the /usr/local/pf/conf/network.conf file and adding the 
> following to each network:
>
> next_server=1.2.3.X
>
> Then added the following to the /usr/local/pf/lib/pf/services/manager in the 
> “subnet $network netmask …” section between option domain-name-servers and 
> range:
>
> option next-server $net{‘next_server’};
>
> I then run service packetfence restart.  It is during the Consistency check I 
> get the error.
>
>
>
> Chuck Glover
> [email protected]
>
>
>
> On Jul 14, 2014, at 2:25 PM, Fabrice DURAND <[email protected]> wrote:
>
>> Hi Chuck,
>> you did a mistake in the code.
>> can you paste what you did ?
>>
>> Regards
>> Fabrice
>>
>> Le 2014-07-14 04:24, [email protected] a écrit :
>>> I am new to Packetfence and trying to do a few things that are more on the
>>> advanced side. I am hoping to find some help with them.  I have a few
>>> dhcpd.conf options I need to set.  I found this thread in the
>>> packetfence-users maillist
>>> http://sourceforge.net/p/packetfence/mailman/message/29012241/ so I know
>>> the options can be added.  I have been to add options using the parameters
>>> already initialized by the baseline packetfence install.  But if I add a
>>> new parameter (option next-server X.X.X.X) I get an error stating "Use of
>>> uninitialized value in concatenation (.) or string at
>>> /usr/local/pf/lib/pf/services/manager/dhcpd.pm.  I've added the variable in
>>> the network.conf file and tried adding it to the pfcmd.pm, checkup.pm and
>>> pfcmd_pregrammar.pm files all resulting in the same error.
>>>
>>> So I guess I need help in how to add thing to the dhcpd.pm file as
>>> mentioned in the above link and have the additions take.
>>>
>>> Thanks much in advance.
>>>
>>> Chuck
>>>
>>> --------------------------------------------------------------------
>>> mail2web.com  Enhanced email for the mobile individual based on Microsoft
>>> Exchange - http://link.mail2web.com/Personal/EnhancedEmail
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Want fast and easy access to all the code in your enterprise? Index and
>>> search up to 200,000 lines of code with a free copy of Black Duck&#174;
>>> Code Sight&#153; - the same software that powers the world's largest code
>>> search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> PacketFence-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/packetfence-users
>>
>> -- 
>> Fabrice Durand
>> [email protected] ::  +1.514.447.4918 (x135) ::  www.inverse.ca
>> Inverse inc. :: Leaders behind SOGo (http://www.sogo.nu) and PacketFence 
>> (http://packetfence.org)
>>
>>
>> ------------------------------------------------------------------------------
>> Want fast and easy access to all the code in your enterprise? Index and
>> search up to 200,000 lines of code with a free copy of Black Duck&#174;
>> Code Sight&#153; - the same software that powers the world's largest code
>> search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> PacketFence-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/packetfence-users
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> PacketFence-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/packetfence-users


-- 
Fabrice Durand
[email protected] ::  +1.514.447.4918 (x135) ::  www.inverse.ca
Inverse inc. :: Leaders behind SOGo (http://www.sogo.nu) and PacketFence 
(http://packetfence.org)


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to