Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/php
<?php
$cmd = "/usr/lib/update-notifier/update-motd-reboot-required";
$out = array();
$returnvar = 0;
$return = exec($cmd, $out, $returnvar);
if($returnvar != 0)
{
echo "UNKNOWN: Error retrieving reboot status";
exit(3);
}
if($return == "*** System restart required ***")
{
echo "WARNING: *** System restart required ***\n";
exit(1);
}
echo "OK\n";
exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment