masqmail

annotate contrib/guess-hostname @ 160:60c92aa59911

added a script to guess the host's name
author meillo@marmaro.de
date Thu, 08 Jul 2010 11:27:03 +0200
parents
children 71dcdc2020bc
rev   line source
meillo@160 1 #!/bin/sh
meillo@160 2 #
meillo@160 3 # try several ways to guess the hostname
meillo@160 4
meillo@160 5 (
meillo@160 6
meillo@160 7 # this is what Debian uses
meillo@160 8 cat /etc/mailname
meillo@160 9
meillo@160 10 # this is often the short hostname
meillo@160 11 cat /etc/hostname
meillo@160 12
meillo@160 13 # this file was mentioned on the Internet
meillo@160 14 cat /etc/HOSTNAME
meillo@160 15
meillo@160 16 # probably a good value on GNU/Linux
meillo@160 17 hostname -f
meillo@160 18
meillo@160 19 # often the short hostname, but widely available
meillo@160 20 hostname
meillo@160 21
meillo@160 22 ) 2>/dev/null | sort -u