use POSIX recommendation to check availability of 'hostname' command
removed use of tmp variable
tabs-to-spaces