Fix Use $(...) notation instead of legacy backticked

https://github.com/koalaman/shellcheck/wiki/SC2006
This commit is contained in:
Jeremy Gardais 2020-02-19 15:22:09 +01:00
parent 393f9996d2
commit 19afed7c2e
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ while read LINE
do do
DISK=$(echo "${LINE}" | cut -d" " -f1) DISK=$(echo "${LINE}" | cut -d" " -f1)
TYPE=$(echo "${LINE}" | cut -d" " -f3) 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=$? DCODE=$?
DSTBY=$(( $DCODE & 2 )) DSTBY=$(( $DCODE & 2 ))
DFAIL=$(( $DCODE & 8 )) DFAIL=$(( $DCODE & 8 ))
@ -42,15 +42,15 @@ do
echo "" >>/tmp/dres echo "" >>/tmp/dres
done < /tmp/dscan >/tmp/dcheck 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 $XYMON $XYMSRV "status ${MACHINE}.smart ${COLOR} SMART health check
`cat /tmp/dcheck | cut -c2-` $(cat /tmp/dcheck | cut -c2-)
==================== Detailed status ==================== ==================== Detailed status ====================
`cat /tmp/dres` $(cat /tmp/dres)
" "
rm -f /tmp/dres /tmp/dcheck /tmp/dscan rm -f /tmp/dres /tmp/dcheck /tmp/dscan