]> code.delx.au - monosys/commitdiff
check-local-updates
authorJames Bunton <jamesbunton@delx.net.au>
Thu, 18 Jun 2020 13:37:41 +0000 (23:37 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Thu, 18 Jun 2020 13:37:41 +0000 (23:37 +1000)
bin/check-local-updates [new file with mode: 0644]

diff --git a/bin/check-local-updates b/bin/check-local-updates
new file mode 100644 (file)
index 0000000..52397b1
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -eu
+
+. /etc/os-release
+
+function is_debian {
+    [ "$ID" = debian ] || [ "${ID_LIKE:-}" = debian ]
+}
+
+function is_arch {
+    [ "$ID" = arch ]
+}
+
+if is_debian; then
+    aptitude search ~U
+fi
+
+if is_arch; then
+    checkupdates
+fi