summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2006-10-13 19:03:35 +0000
committerJonas Smedegaard <dr@jones.dk>2006-10-13 19:03:35 +0000
commitf1431d4a04e057243f5bf6dfe621092698765693 (patch)
treec80c2af578d62646c73930db4b9c182001559eec
parent275a0cf6d7b1ef35e8a4cfc69988f15bdf5049c4 (diff)
New(ly finished) script to invoke (or kill if hung) offlineimap.
-rwxr-xr-xlocalsyncmail18
1 files changed, 18 insertions, 0 deletions
diff --git a/localsyncmail b/localsyncmail
new file mode 100755
index 0000000..0a4bdd0
--- /dev/null
+++ b/localsyncmail
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+me=$(whoami)
+user=${1:-$me}
+host=${2:-localhost}
+
+#pkill -KILL -f offlineimap || nice x-terminal-emulator -e "offlineimap || echo 'Application died - hit return to quit!'; read"
+#pkill -KILL -f offlineimap || nice x-terminal-emulator -e \( offlineimap \|\| read \)
+
+if [ "$user" = "$me" ] && [ "$host" = "localhost" ]; then
+ command="bash -s"
+else
+ command="ssh -C -X $user@$host bash -s"
+fi
+
+echo "pkill -u $user offlineimap || offlineimap" | $command
+
+exit 0