File:  [Local Repository] / reports / sendletter.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Dec 25 19:24:20 2002 UTC (21 years, 6 months ago) by boris
Branches: letopis
CVS tags: start
Imported sources

#!/bin/sh
ADDRESS="chronicles@chgk.info"
#ADDRESS=boris
PREFIX=http://znatoki.kulichki.net/boris/reports
if ( grep html results.txt > letter1.txt ) ; then
    echo "Sending notification to $ADDRESS"
    echo > letter.txt
    if [ -f letter_start.txt ]; then
	cat letter_start.txt >> letter.txt
	echo >> letter.txt
	echo >> letter.txt
    fi

    echo "Последние обновления в летописи:" >> letter.txt
    echo >> letter.txt
    for x in `cat letter1.txt`; do
	if [ -f $x ]; then
	    echo $PREFIX/$x >> letter.txt
	    head -40 $x | sed '
1,5d
s/<[^>]*>//g
s/<[^>]*$//g
s/^[^<]*>//g
s/&lt;/</g
s/&gt;/>/g
/^[ 	]*$/d
s/^\(.*\)$/   \1/' |head -5  >>letter.txt
	    echo >> letter.txt
	fi
    done
    echo >> letter.txt
    echo "--" >> letter.txt
    echo "Ваш робот" >> letter.txt
    echo >> letter.txt
    fortune /usr/local/share/games/fortunes >> letter.txt
    mail -s "Novosti v letopisi" $ADDRESS <letter.txt
fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>