From: Michael Tremer Date: Mon, 15 Jun 2020 15:07:15 +0000 (+0000) Subject: gcloud: Add function to detect whether we are running on GCP X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7978f5671c8266759b325ee8036b8394191489f;p=people%2Fstevee%2Fipfire-2.x.git gcloud: Add function to detect whether we are running on GCP Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 6ddad28d0d..376b6a09a9 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1296,4 +1296,12 @@ sub running_on_ec2() { return 0; } +sub running_on_gcp() { + if (-e "/var/run/gcp-instance-id") { + return 1; + } + + return 0; +} + 1;