Mailcmd.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
K |
(M) |
||
Zeile 10: | Zeile 10: | ||
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
− | # | + | # get params |
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
CMDNAME=`basename $0` | CMDNAME=`basename $0` | ||
Zeile 21: | Zeile 21: | ||
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
− | # | + | # set some variables |
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
LOGCMD="logger -t $CMDNAME" | LOGCMD="logger -t $CMDNAME" | ||
− | |||
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
− | # | + | # log the parameters |
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
$LOGCMD "========================================================" | $LOGCMD "========================================================" | ||
− | + | $LOGCMD "AccountName : '$ACCOUNTNAME'" | |
− | $LOGCMD "AccountName | + | $LOGCMD "UserName : '$USERNAME'" |
− | $LOGCMD "UserName | + | $LOGCMD "New / Total : $COUNT_NEW / $COUNT_TOTAL" |
− | $LOGCMD "New / Total | + | |
$LOGCMD "========================================================" | $LOGCMD "========================================================" | ||
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
− | # | + | # send a message to vdr |
#------------------------------------------------------------------ | #------------------------------------------------------------------ | ||
− | + | if [ "$COUNT_NEW" -ne "0" ] ; then | |
− | if | + | svdrpsend.pl -p ${VDR_PORT:-2001} MESG "New mail in $ACCOUNTNAME" |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
fi | fi | ||
− | + | exit $? | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | exit $ | + | |
</pre> | </pre> | ||
}} | }} | ||
[[Kategorie:Scripts]] | [[Kategorie:Scripts]] |
Version vom 28. Juli 2005, 18:55 Uhr
Script vom mailbox-plugin.
#!/bin/sh # # mailcmd.sh # # source: vdr-plugin mailbox #------------------------------------------------------------------ # 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" #------------------------------------------------------------------ # log the parameters #------------------------------------------------------------------ $LOGCMD "========================================================" $LOGCMD "AccountName : '$ACCOUNTNAME'" $LOGCMD "UserName : '$USERNAME'" $LOGCMD "New / Total : $COUNT_NEW / $COUNT_TOTAL" $LOGCMD "========================================================" #------------------------------------------------------------------ # send a message to vdr #------------------------------------------------------------------ if [ "$COUNT_NEW" -ne "0" ] ; then svdrpsend.pl -p ${VDR_PORT:-2001} MESG "New mail in $ACCOUNTNAME" fi exit $?