summaryrefslogtreecommitdiffstats
path: root/update_checker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update_checker.sh')
-rwxr-xr-xupdate_checker.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/update_checker.sh b/update_checker.sh
new file mode 100755
index 0000000..bee0543
--- /dev/null
+++ b/update_checker.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+cmd="pacman -Qu"
+pac_num=$($cmd | grep -o "Targets ([0-9]*)" | sed 's/Targets (//; s/)//')
+#$cmd | grep "Total Download Size: .*MB" | grep -o "[0-9].*"
+
+if [ ! $pac_num ]; then
+ pac_num=0
+fi
+
+if [ $pac_num -gt 0 ]; then
+ echo "${HOSTNAME}: $pac_num"
+else
+ echo "${HOSTNAME}: ok"
+fi