When the YACY_DATA_PATH environment variable is set, shell scripts will now use the given path instead of relative ../DATA which remains the default when the variable is not set. Necessary in the context of Snap package (see issue #254) as YaCy is started with startYACY.sh and an absolute DATA parent path in parameter.pull/258/head
parent
07730fe040
commit
17ad1f7e65
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env sh
|
||||
# Fill the YACY_BIN_PATH, YACY_APP_PATH and the YACY_DATA_PATH (when empty) relatively to the current working directory
|
||||
# Then check that the provided YaCy DATA folder exists
|
||||
# Exits with an error message and status 2 when the DATA folder is not found
|
||||
|
||||
YACY_BIN_PATH="`pwd`"
|
||||
YACY_APP_PATH="`dirname $YACY_BIN_PATH`"
|
||||
|
||||
if [ -z "$YACY_DATA_PATH" ]; then
|
||||
YACY_DATA_PATH="$YACY_APP_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
|
@ -1,8 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
cd "`dirname $0`/.."
|
||||
for i in DATA/INDEX/* ; do
|
||||
cd "`dirname $0`"
|
||||
. ./checkDataFolder.sh
|
||||
|
||||
|
||||
for i in "$YACY_DATA_PATH/INDEX"/* ; do
|
||||
if [ -d "$i" ]; then
|
||||
java -cp 'lib/*' org.apache.lucene.index.CheckIndex $i/SEGMENTS/solr_46/collection1/data/index/ -fix
|
||||
echo "Checking Solr index at $i..."
|
||||
java -cp "$YACY_APP_PATH/lib/*" org.apache.lucene.index.CheckIndex "$i/SEGMENTS/solr_6_6/collection1/data/index/" -exorcise
|
||||
fi
|
||||
done
|
||||
cd ..
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
cd "`dirname $0`"
|
||||
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
|
||||
. ./checkDataFolder.sh
|
||||
|
||||
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
|
||||
./search1.sh -y localhost:$port "$1"
|
@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
cd "`dirname $0`"
|
||||
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
|
||||
. ./checkDataFolder.sh
|
||||
|
||||
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
|
||||
./searchall1.sh -s localhost:$port $1
|
Loading…
Reference in new issue