gcloud: Add function to detect whether we are running on GCP

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2020-06-15 15:07:15 +00:00
parent 4e58ab4bbf
commit e7978f5671

View File

@@ -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;