summaryrefslogtreecommitdiff
path: root/sys.sh
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:40:32 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:40:32 +0300
commitd3a6869c1af91bfa74c86ab766f2b934bd2c7ae4 (patch)
treec40183373b69edde47688c38fe820169193847f4 /sys.sh
add screenshot.sh, since.sh, sys.sh
Diffstat (limited to 'sys.sh')
-rwxr-xr-xsys.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys.sh b/sys.sh
new file mode 100755
index 0000000..7c8973e
--- /dev/null
+++ b/sys.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+INSTALLED=$(cat /usr/lib/modules/extramodules-ARCH/version)
+CURRENT=$(uname -r)
+
+KERNEL=$(echo $CURRENT | cut -d- -f1)
+UPDATES=$(checkupdates)
+
+NUPDATES=0
+STATUS=
+
+if test -n "$UPDATES"; then
+ NUPDATES=$(wc -l <<<$UPDATES)
+fi
+
+if grep -q "^linux " <<<$UPDATES; then
+ STATUS="$STATUS(+)"
+fi
+
+if test "$CURRENT" != "$INSTALLED"; then
+ STATUS="$STATUS(-)"
+fi
+
+echo "<txt>sys: ${KERNEL}${STATUS}, upd: ${NUPDATES}</txt>"
+
+if test -z "$UPDATES"; then
+ echo "<tool>no updates</tool>"
+else
+ echo "<tool>$UPDATES</tool>"
+fi