Script robustified and not using anymore ifconfig.