From: Michael Tremer Date: Wed, 28 Aug 2019 11:51:22 +0000 (+0000) Subject: cloud-init: Launch custom script when detecting Google Cloud X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86c645987374ac09e54027c252c308492205290f;p=people%2Fpmueller%2Fipfire-2.x.git cloud-init: Launch custom script when detecting Google Cloud Signed-off-by: Michael Tremer --- diff --git a/src/initscripts/system/cloud-init b/src/initscripts/system/cloud-init index 79a762b2d1..284e24d7b9 100644 --- a/src/initscripts/system/cloud-init +++ b/src/initscripts/system/cloud-init @@ -13,6 +13,8 @@ case "${1}" in scriptname="/etc/rc.d/helper/aws-setup" elif running_on_azure; then scriptname="/etc/rc.d/helper/azure-setup" + elif running_on_gcp; then + scriptname="/etc/rc.d/helper/gcp-setup" else # This system is not running in the cloud exit 0 @@ -63,6 +65,11 @@ case "${1}" in echo "This system is running on Microsoft Azure" exit 0 + # Check Google + elif running_on_gcp; then + echo "This system is running on Google Cloud" + exit 0 + # The rest else echo "This system is NOT running in the cloud" diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions index 2127a58995..b6e6507d60 100644 --- a/src/initscripts/system/functions +++ b/src/initscripts/system/functions @@ -822,4 +822,16 @@ running_on_azure() { return 1 } +running_on_gcp() { + # Check if the BIOS vendor is "Google" + if [ -r "/sys/devices/virtual/dmi/id/bios_vendor" ]; then + local bios_vendor="$(