Mailcmd.sh
Aus VDR Wiki
Version vom 26. Dezember 2004, 12:46 Uhr von 213.6.77.98 (Diskussion)
#!/bin/sh # # mailcmd.sh - v.0.1 # # source: mailbox-plugin #------------------------------------------------------------------ # get params #------------------------------------------------------------------ CMDNAME=`basename $0` ACCOUNTNAME=$1 USERNAME=$2 # $3 is a dummy (will eventually become host-name) # $4 is a dummy (will eventually become "POP3" | "IMAP") COUNT_NEW=$5 COUNT_TOTAL=$6 #------------------------------------------------------------------ # set some variables #------------------------------------------------------------------ LOGCMD="logger -t $CMDNAME" SVDRPSEND="/usr/local/bin/svdrpsend.pl" #------------------------------------------------------------------ # log the parameters #------------------------------------------------------------------ $LOGCMD "========================================================" $LOGCMD "svdrpsend : '$SVDRPSEND'" $LOGCMD "AccountName : '$ACCOUNTNAME'" $LOGCMD "UserName : '$USERNAME'" $LOGCMD "New / Total : $COUNT_NEW / $COUNT_TOTAL" $LOGCMD "========================================================" #------------------------------------------------------------------ # send a message to vdr #------------------------------------------------------------------ EXTRET=0 if test "$COUNT_NEW" -ne "0"; then $SVDRPSEND "MESG New mail in $ACCOUNTNAME"; EXTRET=$? #else # $SVDRPSEND "MESG NO mail in $ACCOUNTNAME"; fi if test "$EXTRET" != "0"; then $LOGCMD "unable to execute $SVDRPSEND" $LOGCMD "========================================================" fi exit $EXTRET