diff options
| author | luccioman <luccioman@users.noreply.github.com> | 2019-02-04 14:34:37 +0100 |
|---|---|---|
| committer | luccioman <luccioman@users.noreply.github.com> | 2019-02-04 14:34:37 +0100 |
| commit | 7a30bce2176a7f040df3247ee770a5f75e6aecc8 (patch) | |
| tree | f82800beb4643155b2da828afa93cd978487880c /stopYACY.sh | |
| parent | 5e9a08355a18989e456a5e58127e8eeb32196246 (diff) | |
Added a stop command using the existing stop script to the snap package
Diffstat (limited to 'stopYACY.sh')
| -rwxr-xr-x | stopYACY.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/stopYACY.sh b/stopYACY.sh index 75ab92a15..9d256bcae 100755 --- a/stopYACY.sh +++ b/stopYACY.sh @@ -1,15 +1,29 @@ #!/usr/bin/env sh +# Shutdown a running YaCy server through API call +# +# $YACY_DATA_PATH : path to the YaCy DATA folder to use. When not set, the relative ./DATA path is used as a default. + cd `dirname $0` -(bin/protectedPostApiCall.sh "Steering.html" "shutdown=true" > /dev/null && \ +if [ -z "$YACY_DATA_PATH" ]; then + YACY_DATA_PATH="DATA" +fi + +if [ ! -d "$YACY_DATA_PATH" ]; then + echo "Invalid YaCy DATA folder path : $YACY_DATA_PATH" + echo "Please fill the YACY_DATA_PATH environment variable with a valid YaCy DATA folder path." + exit 2 +fi +(bin/protectedPostApiCall.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 DATA/LOG/yacy00.log'") || \ +echo "You can monitor this with 'tail -f $YACY_DATA_PATH/LOG/yacy00.log' and 'fuser $YACY_DATA_PATH/LOG/yacy00.log'") || \ exit $? # wait until the yacy.running file disappears which means that YaCy has terminated # If you don't want to wait, just run this concurrently -while [ -f "DATA/yacy.running" ] +while [ -f "$YACY_DATA_PATH/yacy.running" ] do + echo "WAITING" sleep 1 done |
