diff options
Diffstat (limited to 'localsyncmail')
-rwxr-xr-x | localsyncmail | 18 |
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 |