Skip to content

Commit

Permalink
More attempts to find a valid uuid on intels
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Dec 20, 2022
1 parent 44959de commit c7abb37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/get_uuid
Expand Up @@ -30,7 +30,13 @@ fi
# Try dmidecode
#
if [[ -f /sbin/dmidecode || -f /usr/sbin/dmidecode ]]; then
UUID=$(sudo dmidecode | grep -i 'serial number' | head -1 | awk '{print $3}')
UUID=$(sudo dmidecode | grep -i 'serial number'| head -1 | awk '{print $3}')
if [[ "$UUID" =~ ^\$\(.* ]]; then
UUID=$(sudo dmidecode | grep -i 'UUID' | head -1 | awk '{print $2}')
fi
if [ "$UUID" == "" ] || [ "$UUID" == "0" ] || [ "$UUID" == "Serial" ] || [ "$UUID" == "123456789" ] || [[ "$UUID" =~ ^00*0 ]]; then
UUID=$(sudo dmidecode | grep -i 'UUID' | head -1 | awk '{print $2}')
fi
if [ "$UUID" != "" ] && [ "$UUID" != "0" ]; then
echo "M2-$UUID"
exit 0
Expand Down

0 comments on commit c7abb37

Please sign in to comment.