boot_mesg -n "If you're able to track this"
boot_mesg -n " error down to a bug in one of the files provided by"
boot_mesg -n " ipfire, please be so kind to inform us at"
- boot_mesg " info@ipfire.org.\n"
+ boot_mesg " https://bugzilla.ipfire.org.\n"
boot_mesg_flush
boot_mesg -n "Press Enter to continue or wait a minute..." ${INFO}
boot_mesg "" ${NORMAL}
rm -rf "${path_tmpfs}"
}
+# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify_ec2_instances.html
+running_on_ec2() {
+ local uuid
+
+ # Check if the hypervisor UUID starts with ec2
+ if [ -r "/sys/hypervisor/uuid" ]; then
+ uuid=$(</sys/hypervisor/uuid)
+
+ [ "${uuid:0:3}" = "ec2" ] && return 0
+ fi
+
+ # Check if the DMI product UUID starts with EC2
+ if [ -r "/sys/devices/virtual/dmi/id/product_uuid" ]; then
+ uuid=$(</sys/devices/virtual/dmi/id/product_uuid)
+
+ [ "${uuid:0:3}" = "EC2" ] && return 0
+ fi
+
+ # We are not running on AWS EC2
+ return 1
+}
+
+running_on_azure() {
+ # Check if the vendor is Microsoft
+ if [ -r "/sys/devices/virtual/dmi/id/sys_vendor" ] && \
+ [ "$(</sys/devices/virtual/dmi/id/sys_vendor)" = "Microsoft Corporation" ]; then
+ # Check if this product is a "Virtual Machine"
+ if [ -r "/sys/devices/virtual/dmi/id/product_name" ] && \
+ [ "$(</sys/devices/virtual/dmi/id/product_name)" = "Virtual Machine" ]; then
+ # Yes, we are running on Azure
+ return 0
+ fi
+ fi
+
+ # We are not running on Azure
+ return 1
+}
+
# End $rc_base/init.d/functions