Skip to content

Instantly share code, notes, and snippets.

@michaelficarra
Created September 4, 2011 06:38
Show Gist options
  • Select an option

  • Save michaelficarra/1192405 to your computer and use it in GitHub Desktop.

Select an option

Save michaelficarra/1192405 to your computer and use it in GitHub Desktop.
/etc/cron.daily/kernel-check.sh
#!/bin/bash
running_kernel=`uname -r`
latest_kernel=`rpm -q kernel | tail -n1 | sed -e 's/kernel-//'`
[ "$running_kernel" = "$latest_kernel" ] && exit 0
echo "Running Kernel is $running_kernel but latest installed kernel\
is $latest_kernel. This machine should be rebooted." \
| mail -s "$(hostname): reboot required" root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment