#!/bin/ash
AppFile=`basename $0`
AppDir=`echo $0 | sed -e 's|/'$AppFile'||g'`
$AppDir/napi_on "$5" &
sleep 10
if [ "$2" = "1" ]
then
LD_PRELOAD=$AppDir/../lib/libssl.so.0.9.8:$AppDir/../lib/libcrypto.so.0.9.8 $AppDir/wget "http://www.cbr.ru/scripts/XML_daily.asp" -O "/tmp/cb.xml"
fi
if [ "$3" = "1" ]
then
LD_PRELOAD=$AppDir/../lib/libssl.so.0.9.8:$AppDir/../lib/libcrypto.so.0.9.8 $AppDir/wget "$8" -O "/tmp/meteo.xml"
fi
if [ "$4" = "1" ]
then
LD_PRELOAD=$AppDir/../lib/libssl.so.0.9.8:$AppDir/../lib/libcrypto.so.0.9.8 $AppDir/wget "http://www.hyrax.ru/cgi-bin/bn_xml5.cgi" -O "/tmp/horo.xml"
fi
if [ "$1" = "1" ]
then
LD_PRELOAD=$AppDir/../lib/libssl.so.0.9.8:$AppDir/../lib/libcrypto.so.0.9.8 $AppDir/wget "http://lenta.ru/l/r/EX/import.xml" -O "/tmp/lenta.xml"
fi
kill `pidof napi_on`
var1='
cs
1
0
65535'
var2='
65535
01
monternet05
cs
1
1
1'
echo '' > /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo '' > /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
if [ -f "/tmp/lenta.xml" ]
then
echo "$var1" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "01" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "00000001" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "Lenta.ru: Новости" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "Ежедневная интернет-газета.
Новости со всего мира на русском языке." >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "http://lenta.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
count=7
until [ "`sed $count"q;d" "/tmp/lenta.xml"`" = "" ]
do
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000001" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed $count'q;d' "/tmp/lenta.xml" | sed 's/ href=.*"//' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed `let $count+1`'q;d' "/tmp/lenta.xml" | sed 's/subtitle/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed $count'q;d' "/tmp/lenta.xml" | sed 's/.*href="//;s/".*<\/title>/<\/link>/' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
count=`let $count+7`
done
rm "/tmp/lenta.xml"
fi
if [ -f "/tmp/cb.xml" ]
then
echo "$var1" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "02" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "00000002" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "
Курсы валют" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
sed '2q;d' "/tmp/cb.xml" | sed 's//<\/summary>/' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "http://www.cbr.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000002" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n '/USD/{n;p;}' "/tmp/cb.xml" | sed "s///;s||`sed -n '/USD/{n;n;p;}' "/tmp/cb.xml" | sed 's// /;s|||;s/ //'`|" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n '/USD/{n;n;n;p;}' "/tmp/cb.xml" | sed 's/Value/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "http://www.cbr.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000002" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n '/EUR/{n;p;}' "/tmp/cb.xml" | sed "s///;s||`sed -n '/EUR/{n;n;p;}' "/tmp/cb.xml" | sed 's// /;s|||;s/ //'`|" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n '/EUR/{n;n;n;p;}' "/tmp/cb.xml" | sed 's/Value/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "http://www.cbr.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000002" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n /$6/'{n;p;}' "/tmp/cb.xml" | sed "s///;s||`sed -n /$6/'{n;n;p;}' "/tmp/cb.xml" | sed 's// /;s|||;s/ //'`|" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n /$6/'{n;n;n;p;}' "/tmp/cb.xml" | sed 's/Value/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "http://www.cbr.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
rm "/tmp/cb.xml"
fi
if [ -f "/tmp/meteo.xml" ]
then
sed 's/>>\
"/tmp/meteo.tmp"
mv "/tmp/meteo.tmp" "/tmp/meteo.xml"
echo "$var1" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "03" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "00000003" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "Расписание Погоды:" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
sed '4q;d' "/tmp/meteo.xml" | sed 's/title/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "http://rp5.ru" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000003" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '9q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '11q;d' "/tmp/meteo.xml" | sed 's/description/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '10q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000003" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '16q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '18q;d' "/tmp/meteo.xml" | sed 's/description/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '17q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000003" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '23q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '25q;d' "/tmp/meteo.xml" | sed 's/description/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '24q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000003" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '30q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '32q;d' "/tmp/meteo.xml" | sed 's/description/summary/g' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed '31q;d' "/tmp/meteo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
rm "/tmp/meteo.xml"
fi
if [ -f "/tmp/horo.xml" ]
then
echo "$var1" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "04" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "00000004" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "Ежедневный гороскоп от Hyrax.ru" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
sed -n "/http:\/\/www.hyrax.ru\//{n;n;p;q;}" "/tmp/horo.xml" | sed 's///;s/ 00:00:02 +0300<\/pubDate>/<\/summary>/' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "http://www.hyrax.ru/" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000004" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n "/http:\/\/www.hyrax.ru\/horo.shtml?cur&1&0&0/{g;1!p;};h" "/tmp/horo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n "/http:\/\/www.hyrax.ru\/horo.shtml?cur&1&0&0/{n;p;}" "/tmp/horo.xml" | sed 's/description/summary/;s/$/<\/summary>/' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "http://www.hyrax.ru/horo.shtml?cur&1&0&0" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "$var2" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "00000004" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n "/http:\/\/www.hyrax.ru\/horo.shtml?cur&1&$7&0/{g;1!p;};h" "/tmp/horo.xml" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
sed -n "/http:\/\/www.hyrax.ru\/horo.shtml?cur&1&$7&0/{n;p;}" "/tmp/horo.xml" | sed 's/description/summary/;s/$/<\/summary>/' >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "http://www.hyrax.ru/horo.shtml?cur&1&$7&0" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
rm "/tmp/horo.xml"
fi
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/entry.xml
echo "" >> /ezxlocal/download/appwrite/dynamicidle/di/pluginlib/newsreader/xml/feed.xml
kill `pidof newsreader`