#!/bin/bash EMAILTO="yxz@netwerk.no" EMAILFR="zxy@netwerk.no" SUBJECT="Error importing uploaded EPG." ERRMSG="/root/epg-mailer/epgmsg.txt" NOW="$(date)" COUNT=`ls -l /mnt/universum/*.error 2>/dev/null | wc -l` # Script starting below. if [ $COUNT != 0 ]; then perl /root/epg-mailer/smtp-cli --host=mailrelay.banetele.com --subject "$NOW - $SUBJECT" --from "$EMAILFR" --to "$EMAILTO" --body-plain "$ERRMSG" 2>/dev/null && mv /mnt/universum/*.error /mnt/universum/mailed/ else echo "Saften ær blandad!" >>/tmp/epgok fi