first commit

This commit is contained in:
Yavuz Aydın 2021-01-07 16:10:42 +01:00
parent 061aff6ee8
commit d1ae4aff7d
1 changed files with 2 additions and 4 deletions

View File

@ -50,8 +50,7 @@ fi
function usage() {
cat - <<EOF
Usage: ${APPNAME} [--help]
Usage: ${APPNAME} [--warn]
Usage: ${APPNAME} [-w|--warn] [-h|--help]
This check command checks if a reboot are required after an upgrade. It will
also list packages that requires a reboot to ease the decision for the
@ -128,11 +127,10 @@ function check_running_kernel() {
newest_installed_kernel=`ls -t /boot/vmlinuz-* | sed "s/\/boot\/vmlinuz-//g" | head -n1`
running_kernel=`uname -r`
if [[ $newest_installed_kernel != $running_kernel ]]; then
echo "System reboot is required by: newer kernel (${newest_installed_kernel}) is available, running kernel is ${running_kernel}"
if [ "${warn_only}" == "true" ]; then
echo "System reboot is required by a newer kernel"
exit ${WARNING}
else
echo "System reboot is required by a newer kernel"
exit ${CRITICAL}
fi
else