diff --git a/dsmon.sh b/dsmon.sh index 775b10a..b2470cc 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -340,7 +340,7 @@ SETUPSSH(){ RUNCMD(){ start=`date +%s` rm -f /tmp/.dsmon.runcmd.* - echo -e "${idsCL[White]}Iniating commans on all nodes ... " + echo -en "${idsCL[White]}Iniating commans on all nodes ... " ncount=0 while read hostid hostname hostip hostlimits; do if [ "${hostname}" != "host" ]; then @@ -349,6 +349,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") echo -e "${idsCL[LightGreen]}Done\n" + nc_count=0; lcount=0; completed=false until [ "${completed}" == "true" ]; do for nodecmd in /tmp/.dsmon.runcmd.*.done; do @@ -368,11 +369,11 @@ RUNCMD(){ fi done if [ ${nc_count} -eq ${ncount} ]; then - [ ${lcount} -ne ${nc_count} ] && echo -e "${idsCL[White]}Complete, the command was ran on all nodes\n" + 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} -ne ${nc_count} ] && echo -e "${idsCL[White]}${nc_count} of ${ncount} completed ...\n" lcount=${nc_count} sleep 2s