changeset 162:71dcdc2020bc

guess-hostname: ordered guesses by quality
author meillo@marmaro.de
date Thu, 08 Jul 2010 12:19:11 +0200 (2010-07-08)
parents 6dd3a289989b
children 3914d7cabfbc
files contrib/guess-hostname
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/guess-hostname	Thu Jul 08 11:53:07 2010 +0200
+++ b/contrib/guess-hostname	Thu Jul 08 12:19:11 2010 +0200
@@ -1,22 +1,23 @@
 #!/bin/sh
 #
 # try several ways to guess the hostname
+# earlier output lines are probably better
 
 (
 
 # this is what Debian uses
 cat /etc/mailname
 
+# probably a good value on GNU/Linux
+hostname -f
+
 # this is often the short hostname
 cat /etc/hostname
 
+# often the short hostname, but widely available
+hostname
+
 # this file was mentioned on the Internet
 cat /etc/HOSTNAME
 
-# probably a good value on GNU/Linux
-hostname -f
-
-# often the short hostname, but widely available
-hostname
-
-) 2>/dev/null | sort -u
+) 2>/dev/null