Check that the IP is set before adding a new line to the hosts file

If there is no interface (or no IP address available), hostmanager will add a line starting with `\t` followed by the name of the machine. Instead it should just ignore the entire line