]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/helper/azure-setup
cloud-init: Disable using ISP nameservers
[people/pmueller/ipfire-2.x.git] / src / initscripts / helper / azure-setup
index d497c43b2e99f417387c5b9506a0501a3664d408..291b8e0a4d9f31853c1fd5906ac400677adee2c9 100644 (file)
@@ -58,6 +58,9 @@ prefix2netmask() {
 
 import_azure_configuration() {
        local instance_id="$(get compute/vmId)"
+       if [ -z "${instance_id}" ]; then
+               return 0
+       fi
 
        boot_mesg "Importing Microsoft Azure configuration for instance ${instance_id}..."
 
@@ -237,6 +240,9 @@ import_azure_configuration() {
 
        # Actions performed only on the very first start
        if [ ! -e "/var/ipfire/main/firstsetup_ok" ]; then
+               # Disable using ISP nameservers
+               sed -e "s/^USE_ISP_NAMESERVERS=.*/USE_ISP_NAMESERVERS=off/" -i /var/ipfire/dns/settings
+
                # Enable SSH
                sed -e "s/ENABLE_SSH=.*/ENABLE_SSH=on/g" -i /var/ipfire/remote/settings