yacy_search_server/bin/apicall.sh
orbiter b68deb407a - moved test data from /bin to /test/words
- refactoring of stopYACY.sh by introduction of /bin/apicall which is able to call any api file with attached authorization

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6691 6c8d7289-2bf4-0310-a012-ef5d649a1542
2010-02-22 20:14:16 +00:00

13 lines
439 B
Bash
Executable File

#!/bin/bash
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
pw=$(grep ^adminAccountBase64MD5= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
if which curl &>/dev/null; then
curl -s --header "Authorization: realm=$pw" "http://localhost:$port/$1" > /dev/null
elif which wget &>/dev/null; then
wget -q -t 1 --timeout=5 --header "Authorization: realm=$pw" "http://localhost:$port/$1" -O /dev/null
else
exit 1
fi