masqmail
changeset 162:71dcdc2020bc
guess-hostname: ordered guesses by quality
author | meillo@marmaro.de |
---|---|
date | Thu, 08 Jul 2010 12:19:11 +0200 |
parents | 6dd3a289989b |
children | 3914d7cabfbc |
files | contrib/guess-hostname |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line diff
1.1 --- a/contrib/guess-hostname Thu Jul 08 11:53:07 2010 +0200 1.2 +++ b/contrib/guess-hostname Thu Jul 08 12:19:11 2010 +0200 1.3 @@ -1,22 +1,23 @@ 1.4 #!/bin/sh 1.5 # 1.6 # try several ways to guess the hostname 1.7 +# earlier output lines are probably better 1.8 1.9 ( 1.10 1.11 # this is what Debian uses 1.12 cat /etc/mailname 1.13 1.14 +# probably a good value on GNU/Linux 1.15 +hostname -f 1.16 + 1.17 # this is often the short hostname 1.18 cat /etc/hostname 1.19 1.20 +# often the short hostname, but widely available 1.21 +hostname 1.22 + 1.23 # this file was mentioned on the Internet 1.24 cat /etc/HOSTNAME 1.25 1.26 -# probably a good value on GNU/Linux 1.27 -hostname -f 1.28 - 1.29 -# often the short hostname, but widely available 1.30 -hostname 1.31 - 1.32 -) 2>/dev/null | sort -u 1.33 +) 2>/dev/null