X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshenv;h=9b7092109a7fcf38a0e2adaf882da4dbcb9e1baf;hb=764227657c87ea0c1b85bedfbece407c3a02535d;hp=9a97788c4804687783b6eab41bead2871f34db65;hpb=1d927f2f77c896a86c0176bd878bd13075cdc87e;p=grml-etc-core.git diff --git a/etc/zsh/zshenv b/etc/zsh/zshenv index 9a97788..9b70921 100644 --- a/etc/zsh/zshenv +++ b/etc/zsh/zshenv @@ -26,7 +26,13 @@ [[ -r /etc/environment ]] && source /etc/environment # set environment variables (important for autologin on tty) -export HOSTNAME=${HOSTNAME:-$(hostname)} +if [ -n "${HOSTNAME}" ] ; then + export HOSTNAME="${HOSTNAME}" +elif [[ -x $(which hostname) ]] ; then + export HOSTNAME="$(hostname)" +elif [[ -x $(which hostnamectl) ]] ; then + export HOSTNAME="$(hostnamectl --static)" +fi # make sure /usr/bin/id is available if [[ -x /usr/bin/id ]] ; then