yacy_search_server/bin/checkalive.sh
Marc Nause 8d1b66accc Fix for http://mantis.tokeek.de/view.php?id=432
*) replaced all shebangs with more universal versions
2014-08-25 22:47:33 +02:00

21 lines
476 B
Bash
Executable File

#!/usr/bin/env bash
cd "`dirname $0`"
# 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
# 0 * * * * root cd /usr/share/yacy/bin && ./checkalive.sh
FLAG=0
if [ `./apicall.sh /Status.html | grep "</html>"` ]; then
FLAG=1
fi
if [ $FLAG -eq '0' ]; then
cd ..
timeout 30s ./stopYACY.sh
./killYACY.sh
rm DATA/yacy.running
./startYACY.sh
fi
exit