Mailcmd.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(M)
Zeile 18: Zeile 18:
 
# CONFIG START
 
# CONFIG START
 
   LOGGER="true"
 
   LOGGER="true"
 +
  INTERVAL="3"
 
# CONFIG END
 
# CONFIG END
  
Zeile 30: Zeile 31:
 
logger -t ${0##*/} "========================================================"
 
logger -t ${0##*/} "========================================================"
 
     fi
 
     fi
     svdrpsend.pl -p ${VDR_PORT:-2001} MESG "New mail in $1"
+
     until [ ${c:-0} -eq ${INTERVAL:-1} ] ; do
 +
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "New mail in $1"
 +
c=$((c+1))
 +
sleep 5s
 +
    done
 
fi
 
fi
  

Version vom 24. September 2005, 19:22 Uhr

Script vom mailbox-plugin.

Datei
$PATH/mailcmd.sh
#!/bin/sh
#
# mailcmd.sh
#
# source: vdr-plugin mailbox
#
# $1: name of the account
# $2: user name
# $3: is a dummy (will eventually become host-name)
# $4: is a dummy (will eventually become "POP3" | "IMAP")
# $5: number of new mails in the account
# $6: total-number of mails in the account

# CONFIG START
  LOGGER="true"
  INTERVAL="3"
# CONFIG END

PATH=$PREFIX/bin:$PREFIX/sbin:$PATH

if [ "$5" -ne 0 ] ; then
    if [ "$LOGGER" = true ] ; then
	logger -t ${0##*/} "========================================================"
	logger -t ${0##*/} "AccountName : '$1'"
	logger -t ${0##*/} "UserName    : '$2'"
	logger -t ${0##*/} "New / Total : '$5 / $6'"
	logger -t ${0##*/} "========================================================"
    fi
    until [ ${c:-0} -eq ${INTERVAL:-1} ] ; do
	svdrpsend.pl -p ${VDR_PORT:-2001} MESG "New mail in $1"
	c=$((c+1))
	sleep 5s
    done
fi

exit $?