I am having a really rough time figuring this out. The following script always defaults to the first "if" instead of moving on to the elif statements.
MODEL=`$DMID -s system-product-name`
echo "DMI reports Hardware Identity: $MODEL"
if [[ $MODEL=~ "HP Compaq 6910p*" ]]
echo "Please wait for 6910p"
elif [[ $MODEL=~ "HP Compaq dc7800p*" ]]
echo "Please wait for dc7800p"
echo "$MODEL unsupported currently or drivers not found."
I can even confirm that the first echo outputs "HP Compaq dc7800p Small Form Factor" but then it goes to "Please wait for 6910p" for some reason, leaving me to believe the script isn't moving past the first "if" statement. I cannot wrap my head around why...
The 1st problem is with the output of dmidecode, because I am dealing with output that could have spaces and could have "some" variation.
For example, if dmidecode outputs the following:
"HP Compaq dc7800p Small Form Factor"
I simply want to match "dc7800p" in the script so that if the data polled by DMI is in lowercase, or includes intl. keyboard codes, the script still goes to the relative place.
What am I missing here?