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