Mercurial > 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 (2010-07-08) |
parents | |
children | 71dcdc2020bc |
rev | line source |
---|---|
160 | 1 #!/bin/sh |
2 # | |
3 # try several ways to guess the hostname | |
4 | |
5 ( | |
6 | |
7 # this is what Debian uses | |
8 cat /etc/mailname | |
9 | |
10 # this is often the short hostname | |
11 cat /etc/hostname | |
12 | |
13 # this file was mentioned on the Internet | |
14 cat /etc/HOSTNAME | |
15 | |
16 # probably a good value on GNU/Linux | |
17 hostname -f | |
18 | |
19 # often the short hostname, but widely available | |
20 hostname | |
21 | |
22 ) 2>/dev/null | sort -u |