]> git.cworth.org Git - notmuch-wiki/commitdiff
Merge branch 'master' of git://notmuchmail.org/git/notmuch-wiki
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 15 Apr 2012 05:04:13 +0000 (22:04 -0700)
committerJameson Graef Rollins <jrollins@finestructure.net>
Sun, 15 Apr 2012 05:04:13 +0000 (22:04 -0700)
remoteusage.mdwn
remoteusage/remotewrapper.mdwn [new file with mode: 0644]

index 33a0cf26b3d4bcfe87abbbac727ea215284cb672..2e867e2e4f3e140715b4336a5026607cc24bb597 100644 (file)
@@ -24,7 +24,8 @@ You will need to have the following items in place:
 that computer "client")
 
 3.  `ssh` and `dtach` on your client computer. (TODO: Make dtach
-optional, or allow screen or tmux to be used instead.)
+optional, or allow screen or tmux to be used instead.
+[[Here|remotewrapper]] is a version that does not require dtach.)
 
 4.  password-free login (public key authentication) from client to
 server. [Here](http://www.debian-administration.org/articles/152) is a
diff --git a/remoteusage/remotewrapper.mdwn b/remoteusage/remotewrapper.mdwn
new file mode 100644 (file)
index 0000000..ba1daac
--- /dev/null
@@ -0,0 +1,29 @@
+    #!/bin/bash
+    
+    # Run notmuch on remote host over SSH
+    #
+    # http://notmuchmail.org/remoteusage/
+    #
+    # Put this script in your path and add (setq notmuch-command
+    # "notmuch-remote") to your emacs configuration.
+    #
+    # Add a host specification for "notmuch" to ~/.ssh/config to set the
+    # remote host and (optionally) remote user.
+    #
+    # Host notmuch
+    #     HostName host.example.org
+    #     User username
+    
+    SSH_REMOTE_HOST=notmuch
+    SSH_CONTROL_PATH="-o ControlPath=/tmp/notmuch-remote.${USER}.%r@%h:%p"
+    
+    # Start a background master connection if one isn't running yet
+    ssh ${SSH_CONTROL_PATH} -O check ${SSH_REMOTE_HOST} 2>/dev/null ||
+    ssh ${SSH_CONTROL_PATH} -MNf ${SSH_REMOTE_HOST}
+    
+    # The ControlPersist option (in OpenSSH 5.6) could be used to start
+    # the master connection automatically when "ssh host notmuch" is run.
+    
+    # This requires the bash version of printf (bashism)
+    printf -v ARGS "%q " "$@"
+    ssh ${SSH_CONTROL_PATH} ${SSH_REMOTE_HOST} notmuch ${ARGS}