diff options
Diffstat (limited to '')
-rwxr-xr-x | dotfiles/scripts/check_reboot_needed.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dotfiles/scripts/check_reboot_needed.sh b/dotfiles/scripts/check_reboot_needed.sh new file mode 100755 index 0000000..2483fc6 --- /dev/null +++ b/dotfiles/scripts/check_reboot_needed.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +NEXTLINE=0 +FIND="" +for I in `file /boot/vmlinuz*`; do + if [ ${NEXTLINE} -eq 1 ]; then + FIND="${I}" + NEXTLINE=0 + else + if [ "${I}" = "version" ]; then NEXTLINE=1; fi + fi +done +if [ ! "${FIND}" = "" ]; then + CURRENT_KERNEL=`uname -r` + if [ ! "${CURRENT_KERNEL}" = "${FIND}" ]; then + echo "Reboot required" + fi +fi |