[Vm-dev] Finding ip address for eth0?

John M McIntosh johnmci at smalltalkconsulting.com
Wed Aug 26 22:22:10 UTC 2009


Careful, on my macbook pro, the ethernet port is en0, which is rarely  
used.
But en1 is wireless and mostly used
so the INTERFACE=eth0 is going to be machine dependent


On 26-Aug-09, at 3:15 PM, Andreas Raab wrote:

> David T. Lewis wrote:
>> Assuming that you're not looking for an elegant solution, you could
>> figure it out in the start script and pass it to Squeak as a command
>> line parameter.
>>  #!/bin/sh
>>  INTERFACE=eth0
>>  IPV4_ADDR=`/sbin/ifconfig $INTERFACE | grep 'inet addr' | cut - 
>> c21-34`
>>  echo the IP address on interface $INTERFACE is $IPV4_ADDR
>>  /usr/local/bin/squeak myimage.image $IPV4_ADDR
>
> Wow, without sed? I'm impressed ;-) And you know what, that's just  
> what I'll do. Thanks for the snippet.
>
> Cheers,
>  - Andreas

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:   
squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================






More information about the Vm-dev mailing list