Skip to content

Commit

Permalink
fix hosts entry on new install
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonb3 committed Jan 31, 2024
1 parent a1cd578 commit 4613f30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/dhcpcd_hook_scripts/bubba-fqdn.hook
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fix_fqdn_dynamic_host()
if [ "x${new_ip_address}" != "x" ]; then
echo "bubba-fqdn: update dynamic hosts entry for my name"
local old_hostentry=$(grep "^${new_ip_address}\s" /etc/hosts)
local new_hostnames
local new_hostnames"${new_fqdn_name}\t${my_hostname}"
if [ "x${old_hostentry}" != "x" ]; then
#keep alternate names if defined
local needle=$(echo "^${new_ip_address}\$|${my_hostname}\$|${old_fqdn_name}\$|${new_fqdn_name}\$|localhost|^\$"| sed "s/\./\\\./g")
Expand Down

0 comments on commit 4613f30

Please sign in to comment.