Conversation
check_reboot_req.bash alerts if systems needs rebooting for Debian/Ubuntu systems
| echo "System OK" | ||
| exitstatus=$STATE_OK | ||
| fi | ||
| exit $exitstatus |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| if [ -f "${RFILENAME}" ]; then | ||
| CDATE=$(date +%s) | ||
| FDATE=`stat -c %Y -- "${RFILENAME}"` | ||
| DDIFF=$(($CDATE-$FDATE)) |
There was a problem hiding this comment.
| # | ||
| if [ -f "${RFILENAME}" ]; then | ||
| CDATE=$(date +%s) | ||
| FDATE=`stat -c %Y -- "${RFILENAME}"` |
There was a problem hiding this comment.
Use $(...) notation instead of legacy backticked ....
| if [ -z $warn ]; then | ||
| declare -i warn=0 | ||
| fi | ||
| if [ -z $crit ]; then |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| done | ||
|
|
||
| # Check begins here | ||
| if [ -z $warn ]; then |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| case "$1" in | ||
| --help) | ||
| print_help | ||
| exit $STATE_OK |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| } | ||
|
|
||
| print_help() { | ||
| print_revision $PROGNAME $REVISION |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` | ||
| REVISION="1.0" | ||
|
|
||
| . $PROGPATH/utils.sh |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| TOUCH="/bin/touch" | ||
|
|
||
| PROGNAME=`/usr/bin/basename $0` | ||
| PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
| CHMOD="/bin/chmod" | ||
| TOUCH="/bin/touch" | ||
|
|
||
| PROGNAME=`/usr/bin/basename $0` |
There was a problem hiding this comment.
Double quote to prevent globbing and word splitting.
|
Kudos, SonarCloud Quality Gate passed! |








check_reboot_req.bash alerts if systems needs rebooting for Debian/Ubuntu systems