]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
cloud-init: Extend to support Exoscale
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Sep 2020 10:37:06 +0000 (10:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Sep 2020 10:37:06 +0000 (10:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/cloud-init
src/initscripts/system/functions

index d39552b011d91cfb5f348a8584c78f162a407bf9..0da4e259ac749532a5726e33583e68fb77b5b3da 100644 (file)
@@ -11,6 +11,8 @@ case "${1}" in
                # Check if we are running in the cloud
                if running_on_ec2; then
                        scriptname="/etc/rc.d/helper/aws-setup"
+               elif running_on_exoscale; then
+                       scriptname="/etc/rc.d/helper/exoscale-setup"
                elif running_on_azure; then
                        scriptname="/etc/rc.d/helper/azure-setup"
                elif running_on_gcp; then
@@ -62,6 +64,11 @@ case "${1}" in
                        echo "This system is running on AWS EC2"
                        exit 0
 
+               # Check Exoscale
+               elif running_on_exoscale; then
+                       echo "This system is running on Exoscale"
+                       exit 0
+
                # Check Microsoft
                elif running_on_azure; then
                        echo "This system is running on Microsoft Azure"
index 234b798cf1508148ccade26e21196e786180b099..71edf500b4cd6eb4b447ea848127c7e220d397d7 100644 (file)
@@ -827,6 +827,17 @@ running_on_azure() {
        return 1
 }
 
+running_on_exoscale() {
+       if [ -r "/sys/devices/virtual/dmi/id/sys_vendor" ]; then
+               local sys_vendor="$(</sys/devices/virtual/dmi/id/sys_vendor)"
+
+               [ "${sys_vendor}" = "Exoscale" ] && return 0
+       fi
+
+       # We are not running on Exoscale
+       return 1
+}
+
 running_on_gcp() {
        # Check if the BIOS vendor is "Google"
        if [ -r "/sys/devices/virtual/dmi/id/bios_vendor" ]; then