)
;;
*)
- if [ -r /proc/device-tree/model ]; then
+ if [ -r /proc/device-tree/model ]
+ then
tr -d '\000' < /proc/device-tree/model && echo
- elif [ -r /sys/class/dmi/id/product_name ]; then
+ elif [ -r /sys/class/dmi/id/product_name ]
+ then
cat /sys/class/dmi/id/product_name
- elif which inxi > /dev/null; then
+ elif which hostnamectl > /dev/null
+ then
+ hostnamectl | awk -F': ' '$1 ~ /Hardware Model/{print $2;exit}'
+ elif which inxi > /dev/null
+ then
inxi -M | awk -F': ' '/product:/ {sub(/^.*product: /,""); sub(/[^ ]+:.*/,""); print $0; exit} /System:/ {sub(/^.*System: /,""); sub(/[^ ]+:.*/,""); print $0; exit}'
- elif which lshw > /dev/null; then
+ elif which lshw > /dev/null
+ then
sudo lshw -quiet -class system 2>/dev/null | awk -F': ' '/product: /{print $2; exit}'
fi
;;