Skip to content

Commit

Permalink
Fix it for real
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Sep 14, 2017
1 parent 88b4f59 commit 3bd74f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ set_hostname () {
if grep "^$address" /etc/hosts >/dev/null; then
log_debug "Entry for IP $address exists in /etc/hosts."
log_debug "Updating with new hostname."
sed -i "s/^$address\([\s\t]+\).*$/$address $line $shortname/" /etc/hosts
sed -i "s/^$address.*/$address $line $shortname/" /etc/hosts
else
log_debug "Adding new entry for hostname $line on $address to /etc/hosts."
printf "%s\t%s\t%s\n" "$address" "$line" "$shortname" >> /etc/hosts
Expand Down

0 comments on commit 3bd74f6

Please sign in to comment.