Make sure locale is POSIX before grepping ifconfig output, as in some locale, adress is not shown as inet addr (e.g. for fr_FR.UTF-8, it shows inet adr).