aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorcbreton <corentin.breton@fullsave.com>2020-04-24 16:34:42 +0200
committercbreton <corentin.breton@fullsave.com>2020-04-24 16:34:42 +0200
commitc55d7f3bdf270bd4462e954d702d3bad961c243b (patch)
treebb6c160e01490cc0ae65c4c838218994473aa325 /dotfiles
parent325fe22692c927ce35e99afa9c95f15317fb0ff1 (diff)
downloaddotfiles-c55d7f3bdf270bd4462e954d702d3bad961c243b.tar.xz
dotfiles-c55d7f3bdf270bd4462e954d702d3bad961c243b.zip
Add little script for check if reboot is needed
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