#!/bin/bash


RUNNING_VERSION="$(uname -r)"
INSTALLED_VERSION="$(find /boot -maxdepth 1 -name 'vmlinuz*' | sed 's/\/boot\///' | sort -Vr | head -1 | sed 's/vmlinuz-//')"

#echo $RUNNING_VERSION
#echo $INSTALLED_VERSION

if [[ "$RUNNING_VERSION" == "$INSTALLED_VERSION" ]]
then
  echo "OK"
  exit 1
else
  echo "reboot required"
  exit 0
fi
