Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Setup hostname even if /etc/hostname is not present.

  • Loading branch information...
commit 89731ade6b1ff85368d971b9d83c0d960f7ac4c3 1 parent f113199
@iafonov authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  .chef/bootstrap/server_ubuntu_1_9_3.erb
View
2  .chef/bootstrap/server_ubuntu_1_9_3.erb
@@ -33,7 +33,7 @@ set_hostname_for_ubuntu() {
local host_first="$(echo $hostname | cut -d . -f 1)"
local hostnames="${hostname} ${host_first}"
- sed -i "s/^.*$/$hostname/" /etc/hostname
+ echo $hostname > /etc/hostname
if egrep -q "^127.0.1.1[[:space:]]" /etc/hosts >/dev/null ; then
sed -i "s/^\(127[.]0[.]1[.]1[[:space:]]\+\)/\1${hostnames} /" \
/etc/hosts
Please sign in to comment.
Something went wrong with that request. Please try again.