From bb9a5fa479b1fd8aa7522b56c0c80985d836c7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Klintrup?= Date: Sun, 3 Dec 2023 15:45:55 +0100 Subject: [PATCH] Changed tr A-Z a-z to tr [:upper:] [:lower:] --- check_smartarray.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_smartarray.sh b/check_smartarray.sh index 618a3a7..67587f9 100644 --- a/check_smartarray.sh +++ b/check_smartarray.sh @@ -1,7 +1,7 @@ #!/bin/sh # NRPE check for Proliant SmartArray Controllers (ciss) -# Written by: Søren Klintrup -# version 1.4.2 +# Written by: Søren Klintrup +# version 1.4.3 PATH="/sbin:/bin:/usr/sbin:/usr/bin" DEVICES="$(camcontrol devlist|grep "COMPAQ RAID"|sed -Ee 's/.*(pass[0-9]{1,3}).*/\1/')" @@ -13,12 +13,12 @@ for DEVICE in ${DEVICES} do DEVICENAME="$(camcontrol devlist|grep ${DEVICE}|sed -Ee 's/.*(da[0-9]{1,3}).*/\1/')" DEVICESTRING="$(camcontrol inquiry ${DEVICE} -D|sed -n -e 's/^[^<]*<\([^>]*\)>.*$/\1/p')" - if [ "$(echo ${DEVICESTRING}|tr A-Z a-z|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/')" = "" ] + if [ "$(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/')" = "" ] then ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: unknown state" if ! [ "${ERR}" = 2 ];then ERR=3;fi else - case $(echo ${DEVICESTRING}|tr A-Z a-z|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/') in + case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/') in int) ERR=2 ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: DEGRADED"