mirror of
				https://github.com/kelseyhightower/kubernetes-the-hard-way.git
				synced 2025-11-04 10:12:35 +03:00 
			
		
		
		
	correct the sed command while set the hostname
This commit is contained in:
		@@ -105,7 +105,7 @@ 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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user