Add support for different ways to get the hostname.

I have installed the script on an OpenWrt machine and there was no "hostname" command available.

I modified the script to get the hostname in two different ways:
* hostname command.
* read the hostname from /proc filesystem.