Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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
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"
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="$(</sys/devices/virtual/dmi/id/bios_vendor)"
+
+ [ "${bios_vendor}" = "Google" ] && return 0
+ fi
+
+ # We are not running on GCP
+ return 1
+}
+
# End $rc_base/init.d/functions