Skip to content

Instantly share code, notes, and snippets.

@kkirsche
Created July 18, 2018 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkirsche/8cbcababa2ac6bd63f97962351efa406 to your computer and use it in GitHub Desktop.
Save kkirsche/8cbcababa2ac6bd63f97962351efa406 to your computer and use it in GitHub Desktop.
Checks if a CentOS system requires a reboot or not. Good for login processes
#!/bin/bash
# requires yum-utils to be installed
if ! needs-restarting -r 2>&1 >> /dev/null; then
echo '**System Restart Required**'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment