mutt/offlineimapsync.sh @ cbbbc897e9b3

moar
author Steve Losh <steve@stevelosh.com>
date Wed, 25 Jul 2012 15:20:18 -0400
parents 2c088480ba9e
children (none)
#!/bin/sh

PID=`cat ~/.offlineimap/pid`
ps aux | grep "[ ]$PID" && kill $PID

function sync_normal {
    echo "NORMAL Sync"
    /usr/local/share/python/offlineimap -o -u quiet
}
function sync_quick {
    echo "QUICK Sync"
    /usr/local/share/python/offlineimap -o -q -u quiet
}

# This is silly.
python -c'import sys, random; sys.exit(random.randint(0, 5))' && sync_normal || sync_quick

exit 0