Created
March 23, 2018 14:36
-
-
Save hansdg1/3116c25d82f5c7449976a43ef3563ebd to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
#set -x | |
LAST_KERNEL=`/bin/rpm -q --last kernel | /usr/bin/head -1 | /usr/bin/perl -pe 's/^kernel-(\S+).*/$1/'` | |
RUNNING_KERNEL=`uname -r` | |
if [[ $LAST_KERNEL != $RUNNING_KERNEL ]]; | |
then | |
echo "**Reboot pending**" | |
echo -e "Installed $LAST_KERNEL\nRunning $RUNNING_KERNEL" | column -t | |
else | |
echo "system OK" | |
fi | |
#rm $0 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment