#!/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 "