diff options
| author | Mikhail Osipov <mike.osipov@gmail.com> | 2019-02-18 12:40:32 +0300 |
|---|---|---|
| committer | Mikhail Osipov <mike.osipov@gmail.com> | 2019-02-18 12:40:32 +0300 |
| commit | d3a6869c1af91bfa74c86ab766f2b934bd2c7ae4 (patch) | |
| tree | c40183373b69edde47688c38fe820169193847f4 /sys.sh | |
add screenshot.sh, since.sh, sys.sh
Diffstat (limited to 'sys.sh')
| -rwxr-xr-x | sys.sh | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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 |
