oci: Add detection for Oracle Cloud

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Michael Tremer
2020-07-21 10:36:39 +00:00
committed by Arne Fitzenreiter
parent 4576ca4cc7
commit 7c24a0d973
2 changed files with 13 additions and 0 deletions

View File

@@ -15,6 +15,8 @@ case "${1}" in
scriptname="/etc/rc.d/helper/azure-setup"
elif running_on_gcp; then
scriptname="/etc/rc.d/helper/gcp-setup"
elif running_on_oci; then
scriptname="/etc/rc.d/helper/oci-setup"
else
# This system is not running in the cloud
exit 0

View File

@@ -834,4 +834,15 @@ running_on_gcp() {
return 1
}
running_on_oci() {
if [ -r "/sys/devices/virtual/dmi/id/chassis_asset_tag" ]; then
local asset_tag="$(</sys/devices/virtual/dmi/id/chassis_asset_tag)"
[ "${asset_tag}" = "OracleCloud.com" ] && return 0
fi
# We are not running on OCI
return 1
}
# End $rc_base/init.d/functions