M #-: Set hostname over hostnamectl only if it's working

pull/207/head v5.11.80
Vlastimil Holer 5 years ago
parent 94f752c936
commit 656472c5de
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -10,7 +10,7 @@ fi
function set_hostname() {
local hostname=$1
if [ -d /run/systemd/system/ ]; then
if [ -d /run/systemd/system/ ] && hostnamectl status >/dev/null 2>/dev/null; then
hostnamectl set-hostname --static "${hostname}"
else
if [ -f /etc/sysconfig/network ]; then

Loading…
Cancel
Save