Vaclav Ovsik wrote: > Hi, > some servers can have DNS domain (or its part) in hostname. I have this > on servers despite it is not recommended to distinguish servers with the > same name, but different domain name in prompt (PS1 redefined with \H). > > Instead of composing hostname the FQDN can be retrieved from hostname > command: > > diff --git a/etckeeper/commit.d/50vcs-commit b/etckeeper/commit.d/50vcs-commit > index 959babb..340f32b 100755 > --- a/etckeeper/commit.d/50vcs-commit > +++ b/etckeeper/commit.d/50vcs-commit > @@ -21,11 +21,7 @@ else > logfile="" > fi > > -hostname=`hostname` > -dnsdomainname=`dnsdomainname 2>/dev/null || true` > -if [ -n "$dnsdomainname" ]; then > - hostname="$hostname.$dnsdomainname" > -fi > +hostname=`hostname -f`
That's what I used to have, but hostname -f does something horrible on Solaris. -- see shy jo
signature.asc
Description: Digital signature