This code should help, from one of my scripts:
### Discover server ips, split and show eth1 only
IPS=$(ip -o -f inet addr show | sed -e 's,.* \(.*\)/.*,\1,' |
grep -v '^127')
set -- $IPS
eth0=$1
shift
eth1=$@
On Wed, May 13, 2009 at 10:27 AM, Philippe ENTZMANN <phili...@phec.net>wrote:
> Hello,
>
> I am writing scripts to automate some tasks in my Ubuntu LTSP server.
> To be clean, I need to guess the IP address of the server (the one used by
> clients) and also the network device (/dev/eth0 for example) used for the
> client network and the network device used for the Internet access.
>
> I can parse some conf file but is there a better/unified approach to get
> those informations ?
>
> PS : Scripts will run on server side
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _____________________________________________________________________
> Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
> https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
> For additional LTSP help, try #ltsp channel on irc.freenode.net
>
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.freenode.net