From 334fe406daa3417a95507919b1e26465ea3207c4 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 28 Mar 2025 08:52:43 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 5089798..4dcdb39 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -395,8 +395,11 @@ RUNCMD_SUB(){ if ssh_output=$(ssh -tq -o ConnectTimeout=5 -o ConnectionAttempts=1 root@${ip} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22} 2>&1) ; then echo -e "${ssh_output}" >> ${tmpfile}.running else - echo -e "${ssh_output}" >> ${tmpfile}.running - # echo -e "${idsCL[Red]} ${host} [${ip}] - Timeout${idsCL[Default]}" >> ${tmpfile}.running + if [ "${ssh_output}" == "" ]; then + echo -e "${idsCL[Red]} ${host} [${ip}] - Timeout${idsCL[Default]}" >> ${tmpfile}.running + else + echo -e "${ssh_output}" >> ${tmpfile}.running + fi fi mv ${tmpfile}.running ${tmpfile}.done > /dev/null 2>&1 }