Created
September 4, 2011 06:38
-
-
Save michaelficarra/1192405 to your computer and use it in GitHub Desktop.
/etc/cron.daily/kernel-check.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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