#!/bin/bash


RUNNING_VERSION="$(uname -r | grep -o '[0-9]*\.[0-9]*\.[0-9]*-[0-9]*')"
INSTALLED_VERSION="$(find /boot -maxdepth 0 -name 'vmlinuz*' | grep -o '[0-9]*\.[0-9]*\.[0-9]*-[0-9]*' | sort -r | head -1)"

#echo $RUNNING_VERSION
#echo $INSTALLED_VERSION

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