diff --git a/rc/bashrc b/rc/bashrc index 93d55b3b..6abe8cfd 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -134,8 +134,12 @@ fi if hash lsb_release 2> /dev/null; then ( export LC_ALL="en_DK.UTF-8" - hostname --all-fqdns & - hostname --all-ip-addresses + if hash hostname 2> /dev/null; then + hostname --all-fqdns & + hostname --all-ip-addresses & + elif hash hostnamectl 2> /dev/null; then + hostnamectl hostname & + fi printf "\n" printf "$(uptime --pretty)\t$(uptime)\n" printf "\nPresent:\n" @@ -254,9 +258,6 @@ fi #export CLICOLOR=1 #export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx -# znc uses this variable for figuring out hostname -#export HOSTNAME=$(hostname --fqdn) - # Ensure not leaking queries to upstream nameservers (resolv.conf) export LOCALDOMAIN=. # Secureish resolv.conf options (except trust-ad, but systemd also sets it diff --git a/rc/zshrc b/rc/zshrc index 9a205496..54773abe 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -31,8 +31,12 @@ fi if hash lsb_release 2> /dev/null; then ( export LC_ALL="en_DK.UTF-8" - hostname --all-fqdns & - hostname --all-ip-addresses + if hash hostname 2> /dev/null; then + hostname --all-fqdns & + hostname --all-ip-addresses & + elif hash hostnamectl 2> /dev/null; then + hostnamectl hostname & + fi printf "\n" printf "$(uptime --pretty)\t$(uptime)\n" printf "\nPresent:\n" @@ -215,9 +219,6 @@ fi #export CLICOLOR=1 #export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx -# znc uses this variable for figuring out hostname -#export HOSTNAME=$(hostname --fqdn) - # Ensure not leaking queries to upstream nameservers (resolv.conf) export LOCALDOMAIN=. # Secureish resolv.conf options (except trust-ad, but systemd also sets it