fix: Check if serial is readable (#232)
This commit is contained in:
parent
0e5cca6a1e
commit
846c232bd0
1 changed files with 3 additions and 2 deletions
|
@ -100,10 +100,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SM_BIOS=""
|
SM_BIOS=""
|
||||||
|
PS="/sys/class/dmi/id/product_serial"
|
||||||
|
|
||||||
if [ -s "/sys/class/dmi/id/product_serial" ]; then
|
if [ -s "$PS" ] && [ -r "$PS" ]; then
|
||||||
|
|
||||||
BIOS_SERIAL=$(</sys/class/dmi/id/product_serial)
|
BIOS_SERIAL=$(<"$PS")
|
||||||
BIOS_SERIAL="${BIOS_SERIAL//[![:alnum:]]/}"
|
BIOS_SERIAL="${BIOS_SERIAL//[![:alnum:]]/}"
|
||||||
|
|
||||||
if [ -n "$BIOS_SERIAL" ]; then
|
if [ -n "$BIOS_SERIAL" ]; then
|
||||||
|
|
Loading…
Reference in a new issue