]> git.nbdom.net Git - nb.git/commitdiff
sys_model() Add new line, exit from awk after one print
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 6 Apr 2023 19:48:22 +0000 (21:48 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 6 Apr 2023 19:48:22 +0000 (21:48 +0200)
etc/profile.d/sys.sh

index b565ac9fa304535e2a6fb2bd560c815baa25f400..0bc8cd6fa9d691e0ff68cd411abf3c06c6ad28f0 100644 (file)
@@ -48,9 +48,9 @@ sys_model() {
                ;;
                *)
                        if [ -e /proc/device-tree/model ]; then
-                               tr -d '\000' < /proc/device-tree/model
+                               tr -d '\000' < /proc/device-tree/model && echo
                        elif which lshw > /dev/null; then
-                               lshw -quiet -class system 2>/dev/null | awk -F': ' '/product: /{print $2}'
+                               lshw -quiet -class system 2>/dev/null | awk -F': ' '/product: /{print $2; exit}'
                        fi
                ;;
        esac