From e9f8f284eabd6d87c3581e3bf9befb870c3dd075 Mon Sep 17 00:00:00 2001 From: iliajie Date: Sun, 27 Nov 2022 22:24:48 +0200 Subject: [PATCH] Fix to always set hostname using `hostnamectl` command as well --- slib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/slib.sh b/slib.sh index 0cbedd4..0f84b4e 100644 --- a/slib.sh +++ b/slib.sh @@ -495,6 +495,7 @@ set_hostname () { else hostname "$line" echo "$line" > /etc/hostname + hostnamectl set-hostname "$line" 1>/dev/null 2>&1 detect_ip shortname=$(echo "$line" | cut -d"." -f1) if grep "^$address" /etc/hosts >/dev/null; then