mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
17ad1f7e65
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.
16 lines
583 B
Bash
Executable File
16 lines
583 B
Bash
Executable File
#!/usr/bin/env sh
|
|
cd "`dirname $0`"
|
|
. ./checkDataFolder.sh
|
|
|
|
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
|
|
|
|
if which curl > /dev/null; then
|
|
curl -s "http://localhost:$port/Network.xml?page=2&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'
|
|
elif which wget > /dev/null; then
|
|
wget -q -O - "http://localhost:$port/Network.xml?page=2&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'
|
|
else
|
|
echo "Please install curl or wget" > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|