fix syntax [skip ci]

This commit is contained in:
wh1te909 2023-08-11 22:07:59 +00:00
parent 3ce6b38247
commit cb4bc68c48
3 changed files with 7 additions and 7 deletions

View File

@ -138,8 +138,8 @@ while [[ $letsemail != *[@]*[.]* ]]; do
done
if grep -q manage_etc_hosts /etc/hosts; then
sudo sed -i '/manage_etc_hosts = True/d' /etc/cloud/cloud.cfg >/dev/null
echo -e "\nmanage_etc_hosts = False" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo sed -i '/manage_etc_hosts: true/d' /etc/cloud/cloud.cfg >/dev/null
echo -e "\nmanage_etc_hosts: false" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo systemctl restart cloud-init >/dev/null
fi

View File

@ -411,8 +411,8 @@ deactivate
print_green 'Restoring hosts file'
if grep -q manage_etc_hosts /etc/hosts; then
sudo sed -i '/manage_etc_hosts = True/d' /etc/cloud/cloud.cfg >/dev/null
echo -e "\nmanage_etc_hosts = False" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo sed -i '/manage_etc_hosts: true/d' /etc/cloud/cloud.cfg >/dev/null
echo -e "\nmanage_etc_hosts: false" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo systemctl restart cloud-init >/dev/null
fi

View File

@ -362,9 +362,9 @@ MESHDOMAIN=$(python manage.py get_config meshdomain)
deactivate
if grep -q manage_etc_hosts /etc/hosts; then
sudo sed -i '/manage_etc_hosts = True/d' /etc/cloud/cloud.cfg >/dev/null
if ! grep -q "manage_etc_hosts = False" /etc/cloud/cloud.cfg; then
echo -e "\nmanage_etc_hosts = False" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo sed -i '/manage_etc_hosts: true/d' /etc/cloud/cloud.cfg >/dev/null
if ! grep -q "manage_etc_hosts: false" /etc/cloud/cloud.cfg; then
echo -e "\nmanage_etc_hosts: false" | sudo tee --append /etc/cloud/cloud.cfg >/dev/null
sudo systemctl restart cloud-init >/dev/null
fi
fi