Skip to content

Instantly share code, notes, and snippets.

@drahosistvan
Created June 27, 2017 14:50
Show Gist options
  • Save drahosistvan/2d7aa9b7ec1d7adfd40684e591ae4ae2 to your computer and use it in GitHub Desktop.
Save drahosistvan/2d7aa9b7ec1d7adfd40684e591ae4ae2 to your computer and use it in GitHub Desktop.
Check if restart required on Ubuntu
#!/bin/bash
if [ ! -f /var/run/reboot-required ]; then
# no reboot required (0=OK)
echo "OK: no reboot required"
exit 0
else
# reboot required (1=WARN)
echo "WARNING: `cat /var/run/reboot-required`"
exit 1
fi
@drahosistvan
Copy link
Author

Basic installation:
wget "https://gist.githubusercontent.com/drahosistvan/2d7aa9b7ec1d7adfd40684e591ae4ae2/raw/bc444b9d5656af75a6fce21240459a38eac90560/restart-required.sh" && chmod +x restart-required.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment