hostname: fix sed call
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 3 seconds

This commit is contained in:
Starbeamrainbowlabs 2022-08-06 19:59:50 +01:00
parent afb3d96060
commit 8cdbd588ee
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -5,10 +5,10 @@ new_hostname="$(ask_text "Set system hostname" "Enter this system's new hostname
task_begin "Updating hostname to ${new_hostname}";
hostnamectl set-hostname "${new_hostname}";
hostname "${new_hostname}";
cp /etc/hosts /etc/hosts.bak;
sed "0,/${old_hostname}/{s/${old_hostname}/${new_hostname/}}" /etc/hosts.bak >/etc/hosts;
sed "0,/${old_hostname}/{s/${old_hostname}/${new_hostname}/g}" /etc/hosts.bak >/etc/hosts;
task_end "${?}";