From f055c114d9618b12b5b09d110f820fcf5b5a3f6f Mon Sep 17 00:00:00 2001 From: jnats Date: Wed, 19 May 2021 13:05:56 +0100 Subject: fixed osname priority issue --- nofetch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'nofetch') diff --git a/nofetch b/nofetch index 8ffc6d1..42651a1 100755 --- a/nofetch +++ b/nofetch @@ -13,15 +13,16 @@ else fi uname -o &> /dev/null -if [ $? -eq 0 ] -then - osname=$(uname -o) -elif [ $(uname -s) == "Darwin" ] + +if [ $(uname -s) == "Darwin" ] then osname=$(sw_vers | cut -d':' -f2- | head -n 1 | xargs) elif [ -f /etc/os-release ] then osname=$(cat /etc/os-release | grep -w NAME | head -1 | sed 's/NAME=//g' | sed 's/\"//g' | sed 's/ Linux//g') +elif [ $? -eq 0 ] +then + osname=$(uname -o) else osname="Unknown" fi -- cgit v1.2.3