add mail notifyer
This commit is contained in:
28
sync-mail.sh
Executable file
28
sync-mail.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
export DISPLAY=:10.0
|
||||||
|
export LOGFILE=/var/log/cron/mail-sync.log
|
||||||
|
export GNUPGHOME=$HOME/.gnupg
|
||||||
|
export PASSWORD_STORE_DIR=$HOME/.password-store
|
||||||
|
export PASSWORD_STORE_GPG_OPTS=-vvv
|
||||||
|
echo "RUNNING MAIL-SYNC" >> $LOGFILE
|
||||||
|
|
||||||
|
|
||||||
|
OFFLINEIMAP=$(offlineimap 2>&1 | tail -n1)
|
||||||
|
NOTMUCH=$(notmuch new)
|
||||||
|
DATE=$(date +"%D%R")
|
||||||
|
|
||||||
|
log() {
|
||||||
|
echo "$1" >> $LOGFILE
|
||||||
|
}
|
||||||
|
notify(){
|
||||||
|
notify-send "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
log "$DATE"
|
||||||
|
log "$OFFLINEIMAP"
|
||||||
|
notify "$OFFLINEIMAP"
|
||||||
|
log "$NOTMUCH"
|
||||||
|
notify "$NOTMUCH"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user