AWS: Ensure the product UUID is uppercase

Newer kernels seem to return this in lowercase format which makes the
comparison to "EC2" fail.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2021-01-13 10:44:16 +00:00
parent baa9712372
commit 80b1dc64f2

View File

@@ -797,6 +797,9 @@ running_on_ec2() {
if [ -r "/sys/devices/virtual/dmi/id/product_uuid" ]; then
uuid=$(</sys/devices/virtual/dmi/id/product_uuid)
# Convert the UUID as uppercase
uuid="${uuid^^}"
[ "${uuid:0:3}" = "EC2" ] && return 0
fi