]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
AWS: Ensure the product UUID is uppercase
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 13 Jan 2021 10:44:16 +0000 (10:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 13 Jan 2021 10:51:58 +0000 (10:51 +0000)
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>
src/initscripts/system/functions

index 31b30e037f40c1b8b7d922bcc5ae35a190024ba9..d610a524d12a89a8a282c0f0eb0941c005685eb1 100644 (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