X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=update_mobile_org;h=3f54a16aa387e2615cc84dc8cec15c42444e3047;hb=1687468e45b4bc79533b9feffe09f9f61aeb5396;hp=f1c98e87f31def9fe221b097278b7f7aa78c543a;hpb=9e51cbcaf54e223eecdfceb361c042ab56908cfa;p=bin.git diff --git a/update_mobile_org b/update_mobile_org index f1c98e8..3f54a16 100755 --- a/update_mobile_org +++ b/update_mobile_org @@ -1,14 +1,28 @@ #!/bin/bash +HOSTNAME=$(hostname) TMPDIR=~/tmp export TMPDIR -. ~/.ssh/ssh_agent_info_$(hostname) +. ~/.ssh/ssh_agent_info_${HOSTNAME} LOCKOPTS=-q +LOCKFILE=$TMPDIR/update_mobile_org if [ -n "$PS1" ]; then LOCKOPTS=-f; fi; -mr -d ~/org-mode up; -with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 1m emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1 -yes|with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 5m emacs --batch -l ~/.emacs \ - --eval '(org-mobile-push)' --eval '(org-mobile-pull)' --eval '(org-save-all-org-buffers)'; -mr -d ~/org-mode commit -m'org mobile automated commit and push'; +LOCKIT="with-lock-ex $LOCKOPTS $LOCKFILE" +TIMEOUT="timeout -k1m 1m" +${LOCKIT} ${TIMEOUT} mr -d ~/org-mode up; +if [ "$HOSTNAME" = "rzlab" ]; then + ${LOCKIT} ${TIMEOUT} mr -d ~/projects/org-notes up; +else + ${LOCKIT} ${TIMEOUT} emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1; +fi; +yes|${LOCKIT} timeout -k1m 5m emacs --batch -l ~/.emacs \ + --eval '(org-mobile-push)' --eval '(org-mobile-pull)' --eval '(org-save-all-org-buffers)'; + +if [ "$HOSTNAME" = "rzlab" ]; then + ${LOCKIT} ${TIMEOUT} \ + mr -d ~/projects/org-notes commit -m'org mobile automated commit and push'; +fi; +${LOCKIT} ${TIMEOUT} \ + mr -d ~/org-mode commit -m'org mobile automated commit and push';