summaryrefslogtreecommitdiffstats
path: root/getimap
blob: 7f2845c99aab9bbe5c320f3ee8199fc22d5739fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#exit
if ! mount | grep -q wormole;then
    echo "Booh.... "
    exit 
fi

if ps auxww | grep -q getmail | grep -v grep;then
    exit
fi


echo "#########################`date`####################" >> ~/logs/getmail.log


left=$(/bin/df -h | grep home | head -1 | awk '{ print $5 }' | tr -d '%')

if [[ $left > 90 ]];then
    echo "Low on space -- quitting" >> ~/logs/getmail.log
    exit 1 
fi

notify-send "Mailman" "....Fetching mails."

setlock -X -n /tmp/locks/getmail getmail -n -q --rcfile=getmailrc.gmail --rcfile=getmailrc.yahoo --rcfile=getmailrc.wnohang --rcfile=getmailrc.gmail2

[[ $? == 0 ]] && notify-send "Mailman" ".. Done "