Table of Contents
Check Reboot required
Script: check_reboot_required
Check if a reboot is required. It works for Centos and Debian/ Ubuntu.
If the reboot is required:
- On Centos it shows the kernel number that will be installed,
- On Debian/ Ubuntu it shows the packages that require the reboot,
Standalone installation
From this repository you need next to this script:
-
inc_pluginfunctions
shared function for all IML checks written in bash
Syntax
$ check_reboot_required [-h]
______________________________________________________________________
CHECK_REBOOT_REQUIRED
v1.6
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_reboot_required.html
______________________________________________________________________
Check if a reboot is required.
It works for Centos and Debian/ Ubuntu and Manjaro
If the reboot is required:
* On Centos it shows the kernel number that will be installed,
* On Debian/ Ubuntu it shows the packages that require the reboot,
* On Manjaro it shows if a newer kernel or which libs require the reboot.
The check for libs uses lsof.
If your distro is based on Arch, Centos or Debian then it easily can be added
in the script if it does not work. Report the distro name to the author.
SYNTAX:
check_reboot_required
OPTIONS:
-h or --help show this help.
PARAMETERS:
None.
EXAMPLE:
check_reboot_required
Examples
No reboot needed
./check_reboot_required
OK: [centos] no reboot required (kernel is up to date: 4.18.0-500.el8.x86_64)
Reboot needed
On CentOs we check an updated kernel
./check_reboot_required
WARNING: [centos] need to reboot for kernel package kernel is not installed (current: 4.18.0-193.el8.x86_64)
Not supported OS: unknown
./check_reboot_required
UNKNOWN: distro [otherlinux] was detected but is not supported (yet).
If your distro is based on Arch, Centos or Debian then it easily can be added in the script. Report the distro name to the author.