diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2010-04-08 16:16:27 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2010-04-08 16:16:27 -0400 |
commit | 615c25dcab8e1af4525fe5bf4d10f0ad761741c4 (patch) | |
tree | 42a945030f5d8a9b7a71ba347e06ae5a1bbb3c94 /commit.d | |
parent | ed156b8c366a56c8eacfa920c1e930e6af6d29a5 (diff) |
Avoid using hostname -f, since on Solaris that sets the hostname to -f. Yay, Unix portability! (Instead, use dnsdomainname if available, and otherwise, fall back to the unqualified hostname.)
Diffstat (limited to 'commit.d')
-rwxr-xr-x | commit.d/50vcs-commit | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit index c726167..da99d14 100755 --- a/commit.d/50vcs-commit +++ b/commit.d/50vcs-commit @@ -2,7 +2,11 @@ set -e message="$1" -hostname=`hostname -f 2>/dev/null || hostname` +hostname=`hostname` +dnsdomainname=`dnsdomainname 2>/dev/null || true` +if [ -n "$dnsdomainname" ]; then + hostname="$hostname.$dnsdomainname" +fi USER= if [ -n "$SUDO_USER" ]; then |