summaryrefslogtreecommitdiff
path: root/bin/movemail
blob: 51002c0a313f3cacb4dba9bbe606cda5b45fc982 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
#    postqueue -f
    killall --user $USER mbsync 2>/dev/null && sleep 5 || true
    killall -9 --user $USER mbsync 2>/dev/null || true
    mbsync --quiet fastmail
else
    echo >&2 ERROR: We\'re offline, cannot sync mail
fi