#!/bin/sh
#
# 巡回用スクリプトのサンプル

PERL="/usr/local/bin/perl"
#PERL='/usr/local/bin/perl5.00562 -I/usr/lib/perl5/site_perl/5.005 -I/usr/lib/perl5/site_perl/5.005/i386-linux/'
NKF="/usr/local/bin/nkf"
DIR="/home/konishi/public_html/hina"

#ここのコメントを外すと、PROXYを通るようになります
#ポート番号の記述をしなかった場合は80が用いられます
#http_proxy="http://proxy.server:portno/"
#export $http_proxy

TMP=/tmp/HINA.$$

cd $DIR
rm -f hina.lock
$NKF -e hina.cfg | $PERL hina.pl | $NKF -j > $TMP
ecode=$?
if [ $ecode != 0 ]
then
	echo "error $ecode"
	if [ $ecode != 2 ]
	then
		rm -f hina.lock
	fi
fi

if [ -s $TMP ]
then
	mv -f $TMP hina.html 
#	rm -f $TMP
else
	rm -f $TMP
fi

# ここのコメントを外すと、リモートアンテナからの参照に適した
# hina.txtが出力されます
$NKF -e hina.html | grep HINA_ | $NKF -j > po.txt
