On Fri, 2009-02-13 at 10:51 -0500, Mcdaid, Paul (GAL:IE319) wrote:
> Scott wrote: 
> > Yes, I believe it is because you are using DHCP. Just enter the values
> 
> > manually and all should be fine
> 
> Scott, you could check the ifcfg-eth0 option: BOOTPROTO=dhcp then do the
> following to get the ip address and subnet mask:
> 
> IP_ADDR=`ifconfig eth0 | grep 'inet ' | cut -d : -f 2 | cut -d ' ' -f 1`
> IP_MASK=`ifconfig eth0 | grep 'inet ' | cut -d : -f 4`
> 
> I used this in the firewall script I wrote a while ago.

That's similar to what the get_def_addr script did, and it breaks with
various localizations (the format of the output of 'ifconfig' changes).

I don't believe that it is onerous to ask an admin just once what the IP
address is at install time (and it only asks if they are using DHCP to
set it).  Using a truly dynamic address for the address of a phone
system would not produce good results anyway.  While some people (myself
included) use DHCP to provide what are essentially static addresses, I
don't think it's out of line to ask for it.  At any rate, it's better
than trying to parse unpredictable output from ifconfig.


_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to