From 19afed7c2e2019487f3866e9856e7240dfb3b329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 19 Feb 2020 15:22:09 +0100 Subject: [PATCH] Fix Use $(...) notation instead of legacy backticked https://github.com/koalaman/shellcheck/wiki/SC2006 --- xymon/plugins/client/ext/smart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xymon/plugins/client/ext/smart b/xymon/plugins/client/ext/smart index ffaec6e..7a46e64 100755 --- a/xymon/plugins/client/ext/smart +++ b/xymon/plugins/client/ext/smart @@ -13,7 +13,7 @@ while read LINE do DISK=$(echo "${LINE}" | cut -d" " -f1) TYPE=$(echo "${LINE}" | cut -d" " -f3) - DRES=`/usr/sbin/smartctl -H -d "${TYPE}" -n standby "${DISK}"` + DRES=$(/usr/sbin/smartctl -H -d "${TYPE}" -n standby "${DISK}") DCODE=$? DSTBY=$(( $DCODE & 2 )) DFAIL=$(( $DCODE & 8 )) @@ -42,15 +42,15 @@ do echo "" >>/tmp/dres done < /tmp/dscan >/tmp/dcheck -COLOR=`cat /tmp/dcheck | awk '{print $1}' | sort | uniq | head -1 | cut -c3-` +COLOR=$(cat /tmp/dcheck | awk '{print $1}' | sort | uniq | head -1 | cut -c3-) $XYMON $XYMSRV "status ${MACHINE}.smart ${COLOR} SMART health check -`cat /tmp/dcheck | cut -c2-` +$(cat /tmp/dcheck | cut -c2-) ==================== Detailed status ==================== -`cat /tmp/dres` +$(cat /tmp/dres) " rm -f /tmp/dres /tmp/dcheck /tmp/dscan