#!/bin/bash ############################################################################################## # # # 88 # # 88 # # 88 # # ,adPPYba, 8b,dPPYba, ,adPPYba, 88 ,adPPYba, ,adPPYba, 88,dPYba,,adPYba, # # I8[ "" 88P' `"8a a8P_____88 88 a8" "" a8" "8a 88P' "88" "8a # # `"Y8ba, 88 88 8PP""""""" 88 8b 8b d8 88 88 88 # # aa ]8I 88 88 "8b, ,aa 88 888 "8a, ,aa "8a, ,a8" 88 88 88 # # `"YbbdP"' 88 88 `"Ybbd8"' 88 888 `"Ybbd8"' `"YbbdP"' 88 88 88 # # # # # ############################################################################################## # # # Author: Andreas Maus / Snel.com - Yavuz Aydin # # E-mail: support@snel.com # # (c) Snel.com - all rights reserved # # # ############################################################################################## # # # Script: check_reboot-required # # License: This file is licensed under the GPLv3 License # # Purpose: Check if reboot is required # # Tested on: CentOS 6/7/8, CloudLinux 7, Debian 7/8/9/10 and Ubuntu 16.04/18.04/20.04 # # Proxmox 6 # # CentOS 8 needs yum-utils installed! # # ############################################################################################## # # # Changelog: # # # ############################################################################################## # # # 2021/01/07 1.0 First release # # # ############################################################################################## APPNAME=`basename $0` # Defining standard messages and exit error levels # https://nagios-plugins.org/doc/guidelines.html OK_EXIT_CODE=0 WARNING_EXIT_CODE=1 CRITICAL_EXIT_CODE=2 UNKNOWN_EXIT_CODE=3 OK_MSG="OK" WARNING_MSG="Warning" CRITICAL_MSG="Critical" UNKNOWN_MSG="Unknown" # Using Unknown as default EXIT_CODE=$UNKNOWN_EXIT_CODE EXIT_MSG=$UNKNOWN_MSG warn_only="false" which lsb_release 2>/dev/null >/dev/null if [ $? -ne 0 ]; then echo "lsb_release is missing" exit ${UNKNOWN_EXIT_CODE} fi function usage() { cat - <