1
0
mirror of https://github.com/larsen0815/check_rasp_temp.git synced 2024-11-24 03:13:50 +01:00

Replace backticks

This commit is contained in:
larsen0815 2023-03-15 11:11:39 +01:00
parent da2be22f88
commit 6fb421ef0c

View File

@ -27,7 +27,7 @@ usage() {
check_prog() { check_prog() {
if [ -z "$PROG" ] ; then if [ -z "$PROG" ] ; then
PROG=`which $1` PROG=$(which $1)
fi fi
if [ -z "$PROG" ] ; then if [ -z "$PROG" ] ; then
@ -77,29 +77,29 @@ fi
# Perform the checks # Perform the checks
TEMP=`vcgencmd measure_temp | awk -F"=" '{print $2}' | awk -F"'" '{print $1}'` TEMP=$(vcgencmd measure_temp | awk -F"=" '{print $2}' | awk -F"'" '{print $1}')
PERF="temp=${TEMP};${WARNING};${CRITICAL};;" PERF="temp=${TEMP};${WARNING};${CRITICAL};;"
if [ "$LOW" == true ] ; then if [ "$LOW" == true ] ; then
COMPARISON=`echo "if($TEMP<=$CRITICAL) 1 else 0;" | bc` COMPARISON=$(echo "if($TEMP<=$CRITICAL) 1 else 0;" | bc)
if [ $COMPARISON -eq 1 ] ; then if [ $COMPARISON -eq 1 ] ; then
echo "TEMPERATURE CRITICAL: $TEMP | $PERF" echo "TEMPERATURE CRITICAL: $TEMP | $PERF"
exit 2 exit 2
fi fi
COMPARISON=`echo "if($TEMP<=$WARNING) 1 else 0;" | bc` COMPARISON=$(echo "if($TEMP<=$WARNING) 1 else 0;" | bc)
if [ $COMPARISON -eq 1 ] ; then if [ $COMPARISON -eq 1 ] ; then
echo "TEMPERATURE WARNING: $TEMP | $PERF" echo "TEMPERATURE WARNING: $TEMP | $PERF"
exit 1 exit 1
fi fi
else else
COMPARISON=`echo "if($TEMP>=$CRITICAL) 1 else 0;" | bc` COMPARISON=$(echo "if($TEMP>=$CRITICAL) 1 else 0;" | bc)
if [ $COMPARISON -eq 1 ] ; then if [ $COMPARISON -eq 1 ] ; then
echo "TEMPERATURE CRITICAL: $TEMP | $PERF" echo "TEMPERATURE CRITICAL: $TEMP | $PERF"
exit 2 exit 2
fi fi
COMPARISON=`echo "if($TEMP>=$WARNING) 1 else 0;" | bc` COMPARISON=$(echo "if($TEMP>=$WARNING) 1 else 0;" | bc)
if [ $COMPARISON -eq 1 ] ; then if [ $COMPARISON -eq 1 ] ; then
echo "TEMPERATURE WARNING: $TEMP | $PERF" echo "TEMPERATURE WARNING: $TEMP | $PERF"
exit 1 exit 1