- if [ "`echo $status | tr -d 'md0123456789: U'`" = "" ]; then
- STATUS=0
- TEXT="OK - RAID is good: $status"
- else
- STATUS=2
- TEXT="ERROR - RAID status: $status"
+ if [ -n "$status" ]; then
+ if [ "`echo $status | tr -d 'md0123456789: U'`" = "" ]; then
+ STATUS=0
+ TEXT="OK - RAID is good: $status"
+ else
+ STATUS=2
+ TEXT="ERROR - RAID status: $status"
+ fi