docs: Fix a bug while setting the hostname for all machines

pull/778/head
Gerson Sosa 2024-04-26 13:56:22 +02:00
parent a9cb5f7ba5
commit d35c209c0a
No known key found for this signature in database
GPG Key ID: EB483461A36ACAC3
1 changed files with 2 additions and 2 deletions

View File

@ -104,8 +104,8 @@ To configure the hostname for each machine, run the following commands on the `j
Set the hostname on each machine listed in the `machines.txt` file: Set the hostname on each machine listed in the `machines.txt` file:
```bash ```bash
while read IP FQDN HOST SUBNET; do while read IP FQDN HOST SUBNET; do
CMD="sed -i 's/^127.0.1.1.*/127.0.1.1\t${FQDN} ${HOST}/' /etc/hosts" CMD="sed -i 's/^127.0.0.1.*/127.0.0.1\t${FQDN} ${HOST}/' /etc/hosts"
ssh -n root@${IP} "$CMD" ssh -n root@${IP} "$CMD"
ssh -n root@${IP} hostnamectl hostname ${HOST} ssh -n root@${IP} hostnamectl hostname ${HOST}
done < machines.txt done < machines.txt