Merge pull request #38 from brunorro/brunorro-centos_context_hostname-2

Modifying file /etc/hostname to set the hostname
pull/43/head
Javi Fontan 9 years ago
commit 0842ebd80c

@ -9,7 +9,8 @@ function set_hostname() {
sed -i '/^HOSTNAME=.*$/d' $CONFIG_FILE
echo "HOSTNAME=$NAME" >> $CONFIG_FILE
[[ $(awk -F= '/^VERSION_ID/ {gsub("\"","");print $2}' /etc/os-release) -ge 7 ]] && echo $NAME > /etc/hostname
hostname $NAME
}

Loading…
Cancel
Save