Mercurial > masqmail
annotate contrib/guess-hostname @ 187:bd7c52a36b0c
improved mservdetect in various ways
errors are handled better (no segfaults anymore)
copied the relevant part of interface.c into mservdetect.c
described how I think the mserver protocol works
author | meillo@marmaro.de |
---|---|
date | Thu, 15 Jul 2010 00:14:26 +0200 |
parents | 71dcdc2020bc |
children | 92b58989a09e |
rev | line source |
---|---|
160 | 1 #!/bin/sh |
2 # | |
3 # try several ways to guess the hostname | |
162
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
4 # earlier output lines are probably better |
160 | 5 |
6 ( | |
7 | |
8 # this is what Debian uses | |
9 cat /etc/mailname | |
10 | |
162
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
11 # probably a good value on GNU/Linux |
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
12 hostname -f |
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
13 |
160 | 14 # this is often the short hostname |
15 cat /etc/hostname | |
16 | |
162
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
17 # often the short hostname, but widely available |
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
18 hostname |
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
19 |
160 | 20 # this file was mentioned on the Internet |
21 cat /etc/HOSTNAME | |
22 | |
162
71dcdc2020bc
guess-hostname: ordered guesses by quality
meillo@marmaro.de
parents:
160
diff
changeset
|
23 ) 2>/dev/null |