Am 27. Oktober 2016 17:10:16 MESZ, schrieb "Sjöholm Per-Olov" <p...@incedo.org>:
> Hi
> 
> If you use a dhclient on the Internet interface, what is the best
> method to
> get the currently used IP address? A regexp to get the IP from
> "ifconfig <if>
> inet”  output or check the dhclient lease file? […]

A regex like this?
ifconfig egress | sed -ne 's/^[[:space:]]inet \([0-9\.]*\) .*/\1/p'

> Thanks
> Peo

Regards, Florian

Reply via email to