return of larch and an is_reboot_needed query
[feisty_meow.git] / scripts / system / is_reboot_needed.sh
diff --git a/scripts/system/is_reboot_needed.sh b/scripts/system/is_reboot_needed.sh
new file mode 100644 (file)
index 0000000..26d65a7
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# returns an error value if reboot IS required due to some recent
+# updates.  otherwise returns a normal zero exit value indicating
+# that things are peachy.
+
+if [ -f /var/run/reboot-required ]; then
+  echo 'reboot required'
+  exit 1
+fi
+exit 0
+
+#hmmm: add other OS versions, e.g.
+#  redhat/centos: $ needs-restarting -r ; echo $?
+#     shows if needs to be rebooted and returns an error if does need reboot
+#