Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

* improved localsearch.sh: * read port from DATA/SETTINGS/yacy.conf * use curl or wget, depending on what is available

f1orif0012554de0b
diff --git a/bin/localsearch.sh b/bin/localsearch.sh
index 5ed4d4392..f85a545ba 100755
--- a/bin/localsearch.sh
+++ b/bin/localsearch.sh
@@ -1 +1,10 @@
-curl -s "http://localhost:8080/yacysearch.rss?query=$1&resource=local&verify=false" | grep link | grep -v opensearchdescription | grep -v yacysearch | grep -v 'yacy:item' | sed 's/<link>//' | sed 's/<\/link>//'
+port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
+if which curl &>/dev/null; then
+ httpfetcher="curl -s"
+elif which wget &>/dev/null; then
+ httpfetcher="wget -q -O - "
+else
+ echo "Neither curl nor wget installed!"
+ exit 1
+fi
+eval $httpfetcher "http://localhost:$port/yacysearch.rss?query=$1&resource=local&verify=false" | grep link | grep -v opensearchdescription | grep -v yacysearch | grep -v 'yacy:item' | sed 's/<link>//' | sed 's/<\/link>//'