commit 29af3677f5c930a97ccb8c71f68601bf63ddaba1 Author: Jonny007-MKD Date: Sun Feb 9 16:33:34 2020 +0100 Initial script diff --git a/check_rebootrequired.sh b/check_rebootrequired.sh new file mode 100755 index 0000000..a33218b --- /dev/null +++ b/check_rebootrequired.sh @@ -0,0 +1,17 @@ +INPUT="/var/run/reboot-required.pkgs" + +if [ ! -f "$INPUT" ]; then + echo "OK" + exit 0 +fi + +NUM_LINES=0 +while IFS= read -r line; do + ((NUM_LINES++)) +done < "$INPUT" + +echo "WARNING: $NUM_LINES packages require a reboot:" +cat "$INPUT" + +exit 1 +