1: #!/bin/sh
2: #ADDRESS="chronicles@chgk.info"
3: ADDRESS=boris
4: PREFIX=http://letopis.chgk.info
5: if ( grep html results.txt > letter1.txt ) ; then
6: echo "Sending notification to $ADDRESS"
7: echo > letter.txt
8: if [ -f letter_start.txt ]; then
9: cat letter_start.txt >> letter.txt
10: echo >> letter.txt
11: echo >> letter.txt
12: fi
13:
14: echo "Последние обновления в летописи:" >> letter.txt
15: echo >> letter.txt
16: for x in `cat letter1.txt`; do
17: if [ -f $x ]; then
18: echo $PREFIX/$x >> letter.txt
19: head -40 $x | sed '
20: 1,5d
21: s/<[^>]*>//g
22: s/<[^>]*$//g
23: s/^[^<]*>//g
24: s/<[a-zA-Z\._0-9-]*@[a-zA-Z\._0-9-]*>/<address>/g
25: /^[ ]*$/d
26: s/^\(.*\)$/ \1/' |head -5 >>letter.txt
27: echo >> letter.txt
28: fi
29: done
30: echo >> letter.txt
31: echo "--" >> letter.txt
32: echo "Ваш робот" >> letter.txt
33: echo >> letter.txt
34: fortune lec >> letter.txt
35: mail -s "Novosti v letopisi" $ADDRESS <letter.txt
36: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>