use lspci if available instead of vl805. Avoid calling vl805 twice.

This commit is contained in:
MilhouseVH
2019-11-09 03:39:53 +00:00
parent 9202943804
commit e204b1f4eb

View File

@@ -388,8 +388,13 @@ getVL805CurrentVersion()
# root then treat the version as unknown and skip VLI updates. # root then treat the version as unknown and skip VLI updates.
VL805_CURRENT_VERSION="" VL805_CURRENT_VERSION=""
if [ "$(id -u)" = "0" ]; then if [ "$(id -u)" = "0" ]; then
if vl805 | grep -q "VL805 FW version"; then if command -v lspci >/dev/null; then
VL805_CURRENT_VERSION=$(vl805 | grep "VL805 FW version" | awk '{print $4}') vlver="$(lspci -d 1106:3483 -xxx | awk '/^50:/ { print "VL805 FW version: " $5 $4 $3 $2 }')"
else
vlver="$(vl805 | grep "VL805 FW version")"
fi
if [ -n "${vlver}" ]; then
VL805_CURRENT_VERSION="${vlver#*: }"
fi fi
fi fi
} }