Skip to content
Snippets Groups Projects
Commit c4a62cc0 authored by zhangxuantong@ihep.ac.cn's avatar zhangxuantong@ihep.ac.cn
Browse files

move to multi-threads

parent 874fe2b3
No related branches found
No related tags found
No related merge requests found
src/proxy_pwd
src/hostlist.txt
remote_logs/
......@@ -45,8 +45,12 @@ else
esac
fi
function execcmd() {
echo -e "Executing on \e[31m$1\e[0m ..."
ssh-copy-id root@$1 &>/dev/null && ssh root@$1 "$remote_command" &>remote_logs/$1.log
echo -e "Finished \e[31m$1\e[0m ..."
}
for remote_host in $(cat src/hostlist.txt | grep -vE "^#" | grep -vE ^$); do
echo -e "Executing on \e[31m$remote_host\e[0m ..."
ssh-copy-id root@$remote_host &>/dev/null && ssh root@$remote_host "$remote_command"
echo -e "Finished \e[31m$remote_host\e[0m ...\n"
execcmd $remote_host &
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment