1: #!/bin/sh
2: ADDRESS="chronicles@chgk.info"
3: #ADDRESS=boris
4: PREFIX=http://znatoki.kulichki.net/boris/reports
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/</</g
25: s/>/>/g
26: /^[ ]*$/d
27: s/^\(.*\)$/ \1/' |head -5 >>letter.txt
28: echo >> letter.txt
29: fi
30: done
31: echo >> letter.txt
32: echo "--" >> letter.txt
33: echo "Ваш робот" >> letter.txt
34: echo >> letter.txt
35: # fortune /usr/local/share/games/fortunes >> letter.txt
36: mail -s "Novosti v letopisi" $ADDRESS <letter.txt
37: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>