Skip to content

Instantly share code, notes, and snippets.

@zandev
Created February 4, 2011 12:21
Show Gist options
  • Select an option

  • Save zandev/811050 to your computer and use it in GitHub Desktop.

Select an option

Save zandev/811050 to your computer and use it in GitHub Desktop.
Does the system need to relaod a new kernel
#!/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