Skip to content

Commit

Permalink
Fix to always set hostname using hostnamectl command as well
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Nov 27, 2022
1 parent e8e3d5d commit e9f8f28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions slib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9f8f28

Please sign in to comment.