summaryrefslogtreecommitdiff
path: root/remoteusage
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2013-04-02 23:13:52 +0300
committerTomi Ollila <tomi.ollila@iki.fi>2013-04-02 23:13:52 +0300
commit6eecd927ff549dcc41c5240dd7868156db4bccc3 (patch)
treeda13050f6ea90399ace8f3e832f423053970721f /remoteusage
parentdf77a5ccd1b0581b1cb3a7ebcf14df7eb048053b (diff)
Ah, referrers are linked!
Diffstat (limited to 'remoteusage')
-rw-r--r--remoteusage/old.mdwn18
1 files changed, 10 insertions, 8 deletions
diff --git a/remoteusage/old.mdwn b/remoteusage/old.mdwn
index 72ba467..7edd7d2 100644
--- a/remoteusage/old.mdwn
+++ b/remoteusage/old.mdwn
@@ -1,6 +1,8 @@
[[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
#Using notmuch remotely#
+(the "old" page, see also [[new|remoteusage]] page)
+
##Why?##
It is hard to keep nomuch tags in sync across multiple instances of
notmuch, on multiple computers. Though you can do this with "notmuch
@@ -56,35 +58,35 @@ future calls can reuse the socket.
NOTMUCH_REMOTE_BIN="notmuch"
DTACH="/usr/bin/dtach"
DTACH_SOCKET="${SOCKET_DIR}/dtach.socket"
-
+
check_for_socket_dir ()
{
[ -d "${SOCKET_DIR}" ]
}
-
+
check_socket_dir_owner_and_perm ()
{
[ "$(stat -c %U ${SOCKET_DIR})" = "$(whoami)" ] &&
[ "$(stat -c %a ${SOCKET_DIR})" = "700" ]
}
-
+
create_socket_dir ()
{
mkdir "${SOCKET_DIR}"
chmod 700 "${SOCKET_DIR}"
}
-
+
check_for_socket ()
{
[ -S "${SSH_SOCKET}" ]
}
-
+
start_socket ()
{
dtach_command="${DTACH} -n ${DTACH_SOCKET} ${SSH_BIN} -M -S ${SSH_SOCKET} ${USER}@${SSH_HOST}"
command -v ${DTACH} &>/dev/null && ${dtach_command}
}
-
+
notmuch_run ()
{
if check_for_socket_dir; then
@@ -103,9 +105,9 @@ future calls can reuse the socket.
printf -v ARGS "%q " "$@"
$SSH_BIN -S $SSH_SOCKET $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN ${ARGS}
}
-
+
notmuch_run "$@"
-
+
Save this to a file, "remote-notmuch.sh", in your path.
Now you can run "remote-notmuch.sh new". You can call the script