masqmail
diff admin/guess-hostname @ 227:cab46cefa4ce
renamed contrib/ to admin/
because the contents are for system admins
and possibly for advanced users too
author | meillo@marmaro.de |
---|---|
date | Fri, 23 Jul 2010 11:49:44 +0200 |
parents | contrib/guess-hostname@92b58989a09e |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/admin/guess-hostname Fri Jul 23 11:49:44 2010 +0200 1.3 @@ -0,0 +1,25 @@ 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 +) 2>/dev/null | uniq 1.27 + 1.28 +exit 0