aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles')
-rwxr-xr-xdotfiles/scripts/check_reboot_needed.sh18
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