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