diff options
author | cbreton <corentin.breton@fullsave.com> | 2020-04-24 16:34:42 +0200 |
---|---|---|
committer | cbreton <corentin.breton@fullsave.com> | 2020-04-24 16:34:42 +0200 |
commit | c55d7f3bdf270bd4462e954d702d3bad961c243b (patch) | |
tree | bb6c160e01490cc0ae65c4c838218994473aa325 /dotfiles | |
parent | 325fe22692c927ce35e99afa9c95f15317fb0ff1 (diff) | |
download | dotfiles_dotdrop-c55d7f3bdf270bd4462e954d702d3bad961c243b.tar.xz dotfiles_dotdrop-c55d7f3bdf270bd4462e954d702d3bad961c243b.zip |
Add little script for check if reboot is needed
Diffstat (limited to 'dotfiles')
-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 |