stable #2
@@ -20,6 +20,9 @@ update_hosts() {
|
||||
hostname=$(get_hostname)
|
||||
|
||||
if [ -n "$hostname" ]; then
|
||||
# Set the hostname using hostnamectl
|
||||
sudo hostnamectl set-hostname "$hostname"
|
||||
echo "Set hostname to: $hostname" >> $LOGFILE
|
||||
update_hosts "$hostname"
|
||||
else
|
||||
echo "No hostname found." >> $LOGFILE
|
||||
|
||||
Reference in New Issue
Block a user