diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-04-27 17:13:50 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-04-27 17:13:50 +0800 |
| commit | 4cdf77a295bc62466a24c7a2aabd893b4bd09554 (patch) | |
| tree | 69c842f27625fcdad911e6a429d2f380a8e7b0e7 /bin/init | |
| parent | 46662787169cd9fd7eb1220aea0bb25309fe6e35 (diff) | |
Update
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 | ||