2015-02-23 22:54:49 +01:00
|
|
|
#!/usr/bin/env sh
|
2014-04-06 01:20:03 +02:00
|
|
|
cd "`dirname $0`"
|
2012-01-02 02:09:49 +01:00
|
|
|
|
2012-06-24 10:57:18 +02:00
|
|
|
# for a production environment with high-availability requirement,
|
|
|
|
# (and if you are using the debian version of yacy)
|
|
|
|
# add the following line in /etc/crontab
|
2012-06-24 10:58:09 +02:00
|
|
|
# 0 * * * * root cd /usr/share/yacy/bin && ./checkalive.sh
|
2012-01-02 02:09:49 +01:00
|
|
|
|
|
|
|
FLAG=0
|
2014-04-06 01:20:03 +02:00
|
|
|
if [ `./apicall.sh /Status.html | grep "</html>"` ]; then
|
|
|
|
FLAG=1
|
|
|
|
fi
|
2012-01-02 02:09:49 +01:00
|
|
|
|
|
|
|
if [ $FLAG -eq '0' ]; then
|
|
|
|
cd ..
|
|
|
|
timeout 30s ./stopYACY.sh
|
|
|
|
./killYACY.sh
|
|
|
|
rm DATA/yacy.running
|
|
|
|
./startYACY.sh
|
|
|
|
fi
|
2014-04-06 01:20:03 +02:00
|
|
|
exit
|