From c55d7f3bdf270bd4462e954d702d3bad961c243b Mon Sep 17 00:00:00 2001 From: cbreton Date: Fri, 24 Apr 2020 16:34:42 +0200 Subject: Add little script for check if reboot is needed --- dotfiles/scripts/check_reboot_needed.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 dotfiles/scripts/check_reboot_needed.sh (limited to 'dotfiles') 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 -- cgit v1.2.1