Model: Add checks for more files

This commit is contained in:
Dylan Araps 2016-08-27 08:48:43 +10:00
parent f3ac997826
commit f7353a6b64

View file

@ -41,8 +41,17 @@ getos() {
getmodel() { getmodel() {
case "$os" in case "$os" in
"Linux") "Linux")
model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)" if [ -f /sys/devices/virtual/dmi/id/product_name ] ||\
model="${model/To Be Filled*}" [ -f /sys/devices/virtual/dmi/id/product_version ]; then
model="$(cat /sys/devices/virtual/dmi/id/product_{name,version} 2>/dev/null)"
model="${model/To Be Filled*}"
elif [ -f /sys/firmware/devicetree/base/model ]; then
model="$(< /sys/firmware/devicetree/base/model)"
elif [ -f /tmp/sysinfo/model ]; then
model="$(< /tmp/sysinfo/model)"
fi
;; ;;
"Mac OS X") model="$(sysctl -n hw.model)" ;; "Mac OS X") model="$(sysctl -n hw.model)" ;;