From 6fae25b305d714b3ab7608fa003f1af9bf024545 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 14 Feb 2023 13:33:23 +0800 Subject: Rename tools into bin --- bin/init/sync.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bin/init/sync.sh (limited to 'bin/init/sync.sh') diff --git a/bin/init/sync.sh b/bin/init/sync.sh new file mode 100755 index 0000000..bcd7bed --- /dev/null +++ b/bin/init/sync.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# If git is working in other process, then don't sync again +pidof git >/dev/null && exit 0 + +# my repo +sync() { + { + cd $1 && [[ -n `git remote -v` ]] || return + } 2>/dev/null + GIT_SSH_COMMAND="ssh -o ControlMaster=no" git pull --quiet || echo Has trouble when syncing `pwd` +} +sync $SETTING_DIR & +sync ~/log & +sync ~/blog & +sync ~/git/vps & +sync ~/.task & +sync ~/.password-store & +sync ~/.vim/vim-init & +sync ~/bean & + +while true; do + if test $(jobs -r | wc -l) -gt 0; then + sleep 1; + else + which notify-send &>/dev/null && notify-send 'Repos synced' + break + fi +done & + +# others repo +#check_upstream ~/git/tig || echo in `pwd` >/dev/tty & + +# thunderbird +#if [[ `cat /etc/hostname` != 'vultr' ]]; then +# rsync -a pham@topo.tw:~/.thunderbird/ ~/.thunderbird & +#fi -- cgit v1.2.3-70-g09d2