Created
February 4, 2011 12:21
-
-
Save zandev/811050 to your computer and use it in GitHub Desktop.
Does the system need to relaod a new kernel
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 | |
| #original idea: http://ubuntuforums.org/archive/index.php/t-1012637.html | |
| installed=$(dpkg --get-selections | grep -e "^linux-image-2\.[0-9]\." | awk '{print $1}' | sort -u | tail -1) | |
| running="linux-image-$(uname -a | awk '{print $3}')" | |
| echo | |
| echo -n 'Reboot needed: ' | |
| if [ "$installed" != "$running" ]; then | |
| echo "YES" | |
| else | |
| echo "NO" | |
| fi | |
| echo | |
| echo "-- most recent installed kernel: $installed" | |
| echo "-- loaded kernel : $running" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment