mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
different algorithm to test checkalive as it depends less on the
existence of wget (or curl) on the OS.
This commit is contained in:
parent
6b0e62ec59
commit
68417a05c5
|
@ -1,19 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
cd "`dirname $0`"
|
||||||
|
|
||||||
# for a production environment with high-availability requirement,
|
# for a production environment with high-availability requirement,
|
||||||
# (and if you are using the debian version of yacy)
|
# (and if you are using the debian version of yacy)
|
||||||
# add the following line in /etc/crontab
|
# add the following line in /etc/crontab
|
||||||
# 0 * * * * root cd /usr/share/yacy/bin && ./checkalive.sh
|
# 0 * * * * root cd /usr/share/yacy/bin && ./checkalive.sh
|
||||||
|
|
||||||
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
|
|
||||||
RESULT=`wget -t 1 --spider http://localhost:$port/Status.html 2>&1`
|
|
||||||
FLAG=0
|
FLAG=0
|
||||||
|
if [ `./apicall.sh /Status.html | grep "</html>"` ]; then
|
||||||
for x in $RESULT; do
|
|
||||||
if [ "$x" = '200' ]; then
|
|
||||||
FLAG=1
|
FLAG=1
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
if [ $FLAG -eq '0' ]; then
|
if [ $FLAG -eq '0' ]; then
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -22,5 +18,4 @@ if [ $FLAG -eq '0' ]; then
|
||||||
rm DATA/yacy.running
|
rm DATA/yacy.running
|
||||||
./startYACY.sh
|
./startYACY.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit
|
exit
|
Loading…
Reference in New Issue
Block a user