diff options
| author | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2011-05-14 09:03:18 +0000 |
|---|---|---|
| committer | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2011-05-14 09:03:18 +0000 |
| commit | c55787d07cf73ecfae824a4cb9fef58d97b78856 (patch) | |
| tree | ad192e8588901897cabe2f73d00c37a07b7c9523 /stopYACY.sh | |
| parent | bade61696f6bd7247b7103dbaca758e4a42534ed (diff) | |
*) revert of r7667
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7720 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'stopYACY.sh')
| -rwxr-xr-x | stopYACY.sh | 71 |
1 files changed, 23 insertions, 48 deletions
diff --git a/stopYACY.sh b/stopYACY.sh index a0ae60f07..3b45c134a 100755 --- a/stopYACY.sh +++ b/stopYACY.sh @@ -1,59 +1,34 @@ #!/bin/sh cd `dirname $0` -# KILL YACY IF SCRIPT HAS BEEN STARTED WITH PARAMETER -f -if [ $# -eq 1 ] +if [ -x `which wget` ] then - if [ $1 = "-f" ] - then - if [ -e "yacy.pid" ] - then - PID=`cat yacy.pid` - kill -9 "$PID" 2> /dev/null - if [ $? -ne 0 ] - then - echo "Unable to force close YaCy, daemon seems to have terminated already." - else - echo "Force closed YaCy (process ID was $PID)." - fi - else - echo "Unable to determine YaCy process ID, aborting operation." - fi - fi - -# ELSE TRY TO STOP YACY GRACEFULLY -else - - if [ -x `which wget` ] - then - bin/apicall.sh "Steering.html?shutdown=true" - - echo "Please wait until the YaCy daemon process terminates [wget]" - echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" + bin/apicall.sh "Steering.html?shutdown=true" - elif [ -x `which curl` ] - then - bin/apicall.sh "Steering.html?shutdown=true" +echo "Please wait until the YaCy daemon process terminates [wget]" +echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" - echo "Please wait until the YaCy daemon process terminates [curl]" - echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" +elif [ -x `which curl` ] +then + bin/apicall.sh "Steering.html?shutdown=true" - elif [ -x `which java` ] - then - # generating the proper classpath - CLASSPATH="" - for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done - for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done +echo "Please wait until the YaCy daemon process terminates [curl]" +echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" - java -classpath classes:htroot:$CLASSPATH net.yacy.yacy -shutdown +elif [ -x `which java` ] +then + # generating the proper classpath + CLASSPATH="" + for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done + for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done - echo "Please wait until the YaCy daemon process terminates [java]" - echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" + java -classpath classes:htroot:$CLASSPATH net.yacy.yacy -shutdown - else - port=`cat DATA/SETTINGS/yacy.conf |grep "^port="|sed "s/.*=//"` - echo "Neither wget nor java could be found or are not executable." - echo "Visit http://localhost:$port/Steering.html?shutdown=true to stop YaCy or (in emergency case) use ./killYACY.sh" - fi + echo "Please wait until the YaCy daemon process terminates [java]" + echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" -fi
\ No newline at end of file +else + port=`cat DATA/SETTINGS/yacy.conf |grep "^port="|sed "s/.*=//"` + echo "Neither wget nor java could be found or are not executable." + echo "Visit http://localhost:$port/Steering.html?shutdown=true to stop YaCy or (in emergency case) use ./killYACY.sh" +fi |
