You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yacy_search_server/bin/checkalive.sh

25 lines
457 B

#!/bin/bash
# add in /etc/crontab
# 0 * * * * yacy cd /home/yacy/production/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
for x in $RESULT; do
if [ "$x" = '200' ]; then
FLAG=1
fi
done
if [ $FLAG -eq '0' ]; then
cd ..
timeout 30s ./stopYACY.sh
./killYACY.sh
rm DATA/yacy.running
./startYACY.sh
fi
exit