From c36b20fbc602d129d9fc87865a11232c9d13082e Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 26 Jan 2024 09:49:11 -0600 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 6072ee4..38404ee 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -390,11 +390,11 @@ RUNCMD(){ RUNCMD_SUB(){ ip=${1} host=${2} - tmpfile=/tmp/.dsmon.runcmd.${host// /} - touch ${tmpfile} + tmpfile=/tmp/.dsmon.runcmd.${host// /-} + touch ${tmpfile}.running echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host} - Running command: ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22}${idsCL[Default]}${idsST[Reset]}" >> ${tmpfile}.running - if ! ssh -tq -o ConnectTimeout=3 -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} > ${tmpfile}.running ; then - echo -e "${idsST[Bold]}${idsCL[Red]} ${host} - Timeout${idsCL[Default]}${idsST[Reset]}" > ${tmpfile}.running + if ! ssh -tq -o ConnectTimeout=3 -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} >> ${tmpfile}.running ; then + echo -e "${idsST[Bold]}${idsCL[Red]} ${host} - Timeout${idsCL[Default]}${idsST[Reset]}" >> ${tmpfile}.running fi mv ${tmpfile}.running ${tmpfile}.done }