TMPDIR=~/tmp
export TMPDIR
. ~/.ssh/ssh_agent_info_$(hostname)
-emacs --batch -l ~/.emacs -f 'org-mobile-push' -f 'org-mobile-pull'
+LOCKOPTS=-q
+if [ -n "$PS1" ]; then
+ LOCKOPTS=-f;
+fi;
+with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org emacs --batch -l ~/.emacs -f 'org-mobile-push' -f 'org-mobile-pull'