]> git.donarmstrong.com Git - bin.git/blobdiff - update_mobile_org
add reset usb bus command
[bin.git] / update_mobile_org
index f1c98e87f31def9fe221b097278b7f7aa78c543a..b124ffd9ea8b1de85fe248864710e6ea4cec5fd8 100755 (executable)
@@ -1,14 +1,32 @@
 #!/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
     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" = "$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;
+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" = "$GIT_HOST" ]; 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';