meillo@160: #!/bin/sh meillo@160: # meillo@160: # try several ways to guess the hostname meillo@162: # earlier output lines are probably better meillo@160: meillo@160: ( meillo@160: meillo@160: # this is what Debian uses meillo@160: cat /etc/mailname meillo@160: meillo@162: # probably a good value on GNU/Linux meillo@162: hostname -f meillo@162: meillo@160: # this is often the short hostname meillo@160: cat /etc/hostname meillo@160: meillo@162: # often the short hostname, but widely available meillo@162: hostname meillo@162: meillo@160: # this file was mentioned on the Internet meillo@160: cat /etc/HOSTNAME meillo@160: meillo@218: ) 2>/dev/null | uniq meillo@218: meillo@218: exit 0