diff options
Diffstat (limited to 'bin/init')
-rwxr-xr-x | bin/init/sync.sh | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/bin/init/sync.sh b/bin/init/sync.sh index ffd91c0..fb939e3 100755 --- a/bin/init/sync.sh +++ b/bin/init/sync.sh | |||
@@ -5,15 +5,16 @@ pidof git >/dev/null && exit 0 | |||
5 | 5 | ||
6 | # my repo | 6 | # my repo |
7 | sync() { | 7 | sync() { |
8 | { | 8 | cd "$1" || return |
9 | cd $1 && [[ -n `git remote -v` ]] || return | 9 | [ -z "$(git remote -v)" ] && return |
10 | } 2>/dev/null | 10 | |
11 | pwd | ||
11 | GIT_SSH_COMMAND="ssh -o ControlMaster=no" git pull --quiet || echo Has trouble when syncing `pwd` | 12 | GIT_SSH_COMMAND="ssh -o ControlMaster=no" git pull --quiet || echo Has trouble when syncing `pwd` |
12 | } | 13 | } |
13 | 14 | ||
14 | while read repo; do | 15 | sed /^#/d ~/.repos | while read -r repo; do |
15 | sync $repo & | 16 | eval "sync $repo &" |
16 | done <~/.repos | 17 | done |
17 | 18 | ||
18 | while true; do | 19 | while true; do |
19 | if test $(jobs -r | wc -l) -gt 0; then | 20 | if test $(jobs -r | wc -l) -gt 0; then |
@@ -26,8 +27,3 @@ done & | |||
26 | 27 | ||
27 | # others repo | 28 | # others repo |
28 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & | 29 | #check_upstream ~/git/tig || echo in `pwd` >/dev/tty & |
29 | |||
30 | # thunderbird | ||
31 | #if [[ `cat /etc/hostname` != 'vultr' ]]; then | ||
32 | # rsync -a pham@topo.tw:~/.thunderbird/ ~/.thunderbird & | ||
33 | #fi | ||