aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/scripts/check_reboot_needed.sh
blob: 2483fc69414f4cbab19f4d1d55d5d2cafcd49d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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