aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-04-27 17:13:50 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-04-27 17:13:50 +0800
commit4cdf77a295bc62466a24c7a2aabd893b4bd09554 (patch)
tree69c842f27625fcdad911e6a429d2f380a8e7b0e7
parent46662787169cd9fd7eb1220aea0bb25309fe6e35 (diff)
Update
-rwxr-xr-xbin/init/sync.sh18
-rwxr-xr-xbin/unix/timer.sh2
-rwxr-xr-xbin/wakeup.sh4
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
7sync() { 7sync() {
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
14while read repo; do 15sed /^#/d ~/.repos | while read -r repo; do
15 sync $repo & 16 eval "sync $repo &"
16done <~/.repos 17done
17 18
18while true; do 19while 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
84trap '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 84trap 'exec 1>&3; [ -n "COMMAND_EXIT" ] && eval "$COMMAND_EXIT" && unset COMMAND_EXIT; echo `date` $1 >>/tmp/timer.sh; ' EXIT HUP
85 85
86while [ $count -lt $SET ]; do 86while [ $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 {} + | \
11xargs -I{} ln -sf {} $BIN_DIR 11xargs -I{} ln -sf {} $BIN_DIR
12 12
13# sync with important git repos 13# sync with important git repos
14setsid ~/bin/sync.sh && \ 14~/bin/sync.sh
15which notify-send &>/dev/null && \
16notify-send 'Repos synced'
17 15
18# Copy context file from vps 16# Copy context file from vps
19rsync -au vps:~/.context ~/.context 17rsync -au vps:~/.context ~/.context