X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=update_mobile_org;h=b124ffd9ea8b1de85fe248864710e6ea4cec5fd8;hb=dcce90e77c92202b5fadca48de6fd1cefc41ff79;hp=3f54a16aa387e2615cc84dc8cec15c42444e3047;hpb=b110890051c6828b9fa67011c13eebe82ff94630;p=bin.git diff --git a/update_mobile_org b/update_mobile_org index 3f54a16..b124ffd 100755 --- a/update_mobile_org +++ b/update_mobile_org @@ -1,9 +1,13 @@ #!/bin/bash +GIT_HOST="linnode" + HOSTNAME=$(hostname) TMPDIR=~/tmp export TMPDIR -. ~/.ssh/ssh_agent_info_${HOSTNAME} +if [ -e ~/.ssh/ssh_agent_info_${HOSTNAME} ]; then + . ~/.ssh/ssh_agent_info_${HOSTNAME} +fi; LOCKOPTS=-q LOCKFILE=$TMPDIR/update_mobile_org if [ -n "$PS1" ]; then @@ -12,7 +16,7 @@ fi; LOCKIT="with-lock-ex $LOCKOPTS $LOCKFILE" TIMEOUT="timeout -k1m 1m" ${LOCKIT} ${TIMEOUT} mr -d ~/org-mode up; -if [ "$HOSTNAME" = "rzlab" ]; then +if [ "$HOSTNAME" = "$GIT_HOST" ]; then ${LOCKIT} ${TIMEOUT} mr -d ~/projects/org-notes up; else ${LOCKIT} ${TIMEOUT} emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1; @@ -20,7 +24,7 @@ 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 +if [ "$HOSTNAME" = "$GIT_HOST" ]; then ${LOCKIT} ${TIMEOUT} \ mr -d ~/projects/org-notes commit -m'org mobile automated commit and push'; fi;