Jak zjistit ip aresu
Ing. Vlastimil Pospíchal
vpospichal na tiscali.cz
Pondělí Březen 24 13:32:57 CET 2003
On Mon, Mar 24, 2003 at 12:01:03PM +0100, Radek Kohout wrote:
> Dobry den
> jak ziskat ip adresu rozhrani eth0
> prikaz ifconfig eth0 samozrejme znam, ale potrebuji do scriptu
> pouze ip adresu.
> neexistuje neco jednodusiho?
> nebo neumi nekdo spolehlive vysekat z ifconfig pouze ipadresu ?
> Radek Kohout
IP_ADDR=`LANG=POSIX /sbin/ifconfig eth0 | sed -ne 's/.*inet addr:\([^ ]*\).*/\1/p'`
MAC_ADDR=`LANG=POSIX /sbin/ifconfig eth0 | sed -ne 's/.*HWaddr \([^ ]*\).*/\1/p'`
...
Kit
--
Ing. Vlastimil Pospíchal
http://www.hoteldrnholec.cz
Další informace o konferenci Linux