Skip to content
Snippets Groups Projects
Commit 87fa02a4 authored by root's avatar root
Browse files

update remote bootstrap

parent 19899f3a
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
remote_command="cd ~; git -C .mysetting pull || git clone https://code.ihep.ac.cn/zhangxuantong/mysetting.git .mysetting; cd .mysetting; source bootstrap.sh git;"
remote_command="cd ~; \
which git &>/dev/null || yum install -y git &>/dev/null; \
git -C .mysetting pull || git clone https://code.ihep.ac.cn/zhangxuantong/mysetting.git .mysetting; \
cd .mysetting; \
source bootstrap.sh git;"
host_list="src/hostlist.txt"
while IFS= read -r remote_host
do
for remote_host in $(cat src/hostlist.txt); do
if [[ "${remote_host:0:1}" != "#" ]]; then
echo "Executing on $remote_host ..."
ssh-copy-id root@$remote_host &>/dev/null
ssh root@$remote_host "$remote_command"
ssh-copy-id root@$remote_host && ssh root@$remote_host "$remote_command"
echo "Finished $remote_host ..."
fi
done < $host_list
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