Skip to content
Snippets Groups Projects
Commit 19899f3a authored by root's avatar root
Browse files

add remote bootstrap

parent cec1edfc
No related branches found
No related tags found
No related merge requests found
src/proxy_pwd
src/hostlist.txt
......@@ -41,12 +41,12 @@ function setVim(){
echo -e "\e[32mConfiguring Vim...\e[0m"
if [[ ! -f ~/.vim/autoload/plug.vim ]]; then
wget -q -P ~/.vim/autoload/ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim -c PlugUpdate -c PlugClean -c qa
vim -E -s -c PlugUpdate -c PlugClean -c qa
else
if [[ $(ls -l ~/.vim/autoload/plug.vim | awk '{print $5}') -eq 0 ]]; then
wget -q -P ~/.vim/autoload/ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
vim -c PlugUpgrade -c PlugUpdate -c PlugClean -c qa
vim -E -s -c PlugUpgrade -c PlugUpdate -c PlugClean -c qa
fi
yes | cp -f $PWD/src/vimrc_base ~/.env/vimrc_base &>/dev/null
if ! grep "source ~/.env/vimrc_base" ~/.vimrc &>/dev/null; then echo -e "source ~/.env/vimrc_base" >> ~/.vimrc; fi
......
#!/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;"
host_list="src/hostlist.txt"
while IFS= read -r remote_host
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"
echo "Finished $remote_host ..."
fi
done < $host_list
#!/bin/bash
sed -i "/source ~\/.bashrc_mysetting/d" ~/.bashrc
sed -i "/source ~\/.vimrc_mysetting/d" ~/.vimrc
rm -f ~/.bashrc_mysetting
rm -f ~/.vimrc_mysetting
\ No newline at end of file
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