summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngar <ingar@osirion.org>2016-04-08 23:53:29 +0200
committerIngar <ingar@osirion.org>2016-04-08 23:53:29 +0200
commit759e171e42b9721364b95249d45d95db8acfce01 (patch)
tree47ce141041f8d68ac22d7b67a11a562a65650ec3
parent42e600f01d629382f661c1c832e95a5070b58b7a (diff)
parent90c8b50dee1809ef60a9ed41d0335d8184d72ec3 (diff)
Merge pull request #4 from illwieckz/master
fix for system with only 1 user connected, fix missing lspci check, now run on Cygwin
-rwxr-xr-xsysinfo.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysinfo.sh b/sysinfo.sh
index 4b80d7f..bdf0c19 100755
--- a/sysinfo.sh
+++ b/sysinfo.sh
@@ -6,7 +6,7 @@
#--- [ OS ] ---------------------------
host=`uname -n`
os=`uname -sr`
-uptime=`uptime | sed -e 's/[ ][ ]*/ /g;s/ [0-9:]* up \(.*\), [0-9]* users.*/\1/'`
+uptime=`uptime | sed -e 's/[ ][ ]*/ /g;s/ [0-9:]* up \(.*\), [0-9]* user.*/\1/'`
#--- [ MEMORY ] -----------------------
mem_total=`cat /proc/meminfo | grep -i MemTotal | awk '{printf "%d",$2/1024;}'`
@@ -47,7 +47,7 @@ disk_free=`echo $sua | awk '{printf "%d",$4/1048576;}'`;
#---[ VGA ] ---------------------------
gpu=''
-if [ -x `which lspci` ]; then
+if which lspci 2>/dev/null; then
gpu_slot=`lspci -mm | grep 'VGA' | head -n 1 | cut -f1 -d' '`
gpu_vendor=`lspci -s "${gpu_slot}" -mm -v | grep '^Vendor' | sed -e 's/Vendor:\t//' | sed -e 's/.*[ ]\[//;s/\].*//' | sed -e 's/, Inc.//;s/ Corporation//;s/ Co.//;s/,Ltd.//'`
gpu_model=`lspci -s "${gpu_slot}" -mm -v | grep '^Device' | sed -e 's/Device:\t//' | sed -e 's/.*[ ]\[//;s/\].*//'`