[Vm-dev] Finding ip address for eth0?
Andreas Raab
andreas.raab at gmx.de
Wed Aug 26 22:15:34 UTC 2009
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
More information about the Vm-dev
mailing list