Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It is not easy in any way. Each linux distribution uses different places to store IP addresses, etc. (more variation if you consider other UNIX variants). You <em>can</em> use, for example, <code>/sbin/ifconfig</code> to obtain the IP addresses of the interfaces, but you cannot even be sure if you'll find it at this place, or at all, etc.</p> <p>Also, given you have that executable, you have to set up a thread calling it to obtain the data with a given period (say 5 seconds), and interpret the output. It may vary, for example, if you have bridges, etc. etc. That is, it is not easy.</p> <p>A solution that comes to my mind is, if you have the opportunity of using GNOME or some other widespread distribution as KDE, you can rely on the messages/informations they give. For example, <code>NetworkManager</code> outputs a signal to the <a href="http://www.freedesktop.org/wiki/Software/dbus" rel="nofollow noreferrer">DBUS standard bus</a> when a device changes. You have to implement a listener for those signal. Information <a href="http://people.redhat.com/dcbw/NetworkManager/NetworkManager%20DBUS%20API.txt" rel="nofollow noreferrer">here</a> (not working right now, so here is a <a href="http://209.85.229.132/search?q=cache:hUnwH0JfIUsJ:people.redhat.com/dcbw/NetworkManager/NetworkManager%2520DBUS%2520API.txt+network+manager+dbus+messages&amp;hl=es&amp;ct=clnk&amp;cd=3&amp;gl=es&amp;client=firefox-a" rel="nofollow noreferrer">cache</a>). Note the different messages when a new interface is added, or when one of them changes the IP address. This is the best way I can think of right now.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload