diff --git a/dsmon.sh b/dsmon.sh index 5c20b06..d33faaa 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -350,7 +350,7 @@ RUNCMD(){ fi done <<< $(MYSQL_PWD="sysmoninsert" mysql -h ${mysqlip} -u sysmoninsert -e "SELECT id,host,ip,limits FROM servermonitor.hosts WHERE disabled=0 ORDER BY host ASC") - nc_count=0; completed=false + nc_count=0; lcount=0; completed=false until [ "${completed}" == "true" ]; do for nodecmd in /tmp/.dsmon.runcmd.*.done; do # HOST=$(grep -oP '(?<=runcmd.).*?(?=.done)' <<< "${nodecmd}") @@ -369,11 +369,12 @@ RUNCMD(){ fi done if [ ${nc_count} -eq ${ncount} ]; then - echo -e "${idsCL[White]}Complete, the command was ran on all nodes\n" + [ ${lcount} -ne ${nc_count} ] && echo -e "${idsCL[White]}Complete, the command was ran on all nodes\n" completed=true break fi echo -e "${idsCL[White]}${nc_count} of ${ncount} completed ...\n" + lcount=${nc_count} sleep 2s done