script cleanup

This commit is contained in:
John Bowdre 2022-12-13 15:25:05 -06:00
parent 340cb8e895
commit 87b627ebcb
2 changed files with 10 additions and 2 deletions

View file

@ -1,4 +1,8 @@
#!/bin/bash -eu #!/bin/bash -eu
echo '>> Enabling legacy VMware Guest Customization...' echo '>> Enabling legacy VMware Guest Customization...'
if grep -q 'disable_vmware_customization' /etc/cloud/cloud.cfg; then
sudo sed -i 's/^disable_vmware_customization:.*$/disable_vmware_customization: True/' /etc/cloud/cloud.cfg
else
echo 'disable_vmware_customization: true' | sudo tee -a /etc/cloud/cloud.cfg echo 'disable_vmware_customization: true' | sudo tee -a /etc/cloud/cloud.cfg
fi
sudo vmware-toolbox-cmd config set deployPkg enable-custom-scripts true sudo vmware-toolbox-cmd config set deployPkg enable-custom-scripts true

View file

@ -1,3 +1,7 @@
#!/bin/sh -eu #!/bin/sh -eu
echo '>> Preserving network settings...' echo '>> Preserving network settings...'
if grep -q 'manual_cache_clean' /etc/cloud/cloud.cfg; then
sudo sed -i 's/^manual_cache_clean.*$/manual_cache_clean: True/' /etc/cloud/cloud.cfg
else
echo 'manual_cache_clean: True' | sudo tee -a /etc/cloud/cloud.cfg echo 'manual_cache_clean: True' | sudo tee -a /etc/cloud/cloud.cfg
fi