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 | |
parent | 46662787169cd9fd7eb1220aea0bb25309fe6e35 (diff) |
Update
-rwxr-xr-x | bin/init/sync.sh | 18 | ||||
-rwxr-xr-x | bin/unix/timer.sh | 2 | ||||
-rwxr-xr-x | bin/wakeup.sh | 4 |
3 files changed, 9 insertions, 15 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 | ||
diff --git a/bin/unix/timer.sh b/bin/unix/timer.sh index ac89c52..c87a836 100755 --- a/bin/unix/timer.sh +++ b/bin/unix/timer.sh | |||
@@ -81,7 +81,7 @@ timer() { | |||
81 | done | 81 | done |
82 | } | 82 | } |
83 | 83 | ||
84 | trap 'exec 1>&3; [ -n "COMMAND_EXIT" ] && eval "$COMMAND_EXIT" && unset COMMAND_EXIT; date >>/tmp/timer.sh; echo $(trap -l $1 | cut -f 2 -d" ") >>/tmp/timer.sh' EXIT HUP | 84 | trap 'exec 1>&3; [ -n "COMMAND_EXIT" ] && eval "$COMMAND_EXIT" && unset COMMAND_EXIT; echo `date` $1 >>/tmp/timer.sh; ' EXIT HUP |
85 | 85 | ||
86 | while [ $count -lt $SET ]; do | 86 | while [ $count -lt $SET ]; do |
87 | [ $stop = true ] && sleep 0.3 && continue | 87 | [ $stop = true ] && sleep 0.3 && continue |
diff --git a/bin/wakeup.sh b/bin/wakeup.sh index 0621c83..87d5727 100755 --- a/bin/wakeup.sh +++ b/bin/wakeup.sh | |||
@@ -11,9 +11,7 @@ find $SETTING_DIR/bin -type f -executable -exec realpath {} + | \ | |||
11 | xargs -I{} ln -sf {} $BIN_DIR | 11 | xargs -I{} ln -sf {} $BIN_DIR |
12 | 12 | ||
13 | # sync with important git repos | 13 | # sync with important git repos |
14 | setsid ~/bin/sync.sh && \ | 14 | ~/bin/sync.sh |
15 | which notify-send &>/dev/null && \ | ||
16 | notify-send 'Repos synced' | ||
17 | 15 | ||
18 | # Copy context file from vps | 16 | # Copy context file from vps |
19 | rsync -au vps:~/.context ~/.context | 17 | rsync -au vps:~/.context ~/.context |