summaryrefslogtreecommitdiff
path: root/bin/checkalive.sh
blob: 870ac4e7afc71e978848527c18bb64819ffac38c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# add in /etc/crontab
# 0 *	* * *	yacy    cd /home/yacy/production/bin && ./checkalive.sh

RESULT=`wget --spider http://localhost:8090/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