diff --git a/bin/search.sh b/bin/search.sh new file mode 100755 index 000000000..aa74583a2 --- /dev/null +++ b/bin/search.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd "`dirname $0`" +port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) +./search1.sh -s localhost:$port '"$1"' \ No newline at end of file diff --git a/bin/search1.sh b/bin/search1.sh new file mode 100755 index 000000000..c66ba5ed3 --- /dev/null +++ b/bin/search1.sh @@ -0,0 +1,33 @@ +#!/bin/bash +cd "`dirname $0`" +if which curl &>/dev/null; then + while getopts "ys" opt; do + case $opt in + y) + shift; + curl -s "http://$1/yacysearch.rss?query=$2" | awk '/^/{ gsub("","" );gsub("<\/link>","" ); print $0 }' + ;; + s) + shift; + curl -s "http://$1/solr/select?q=text_t:$2&start=0&rows=100&fl=sku&wt=rss" | awk '/^/{ gsub("","" );gsub("<\/link>","" ); print $0 }' + ;; + esac + done +elif which wget &>/dev/null; then + while getopts "ys" opt; do + case $opt in + y) + shift; + wget -q -O - "http://$1/yacysearch.rss?query=$2" | awk '/^/{ gsub("","" );gsub("<\/link>","" ); print $0 }' + ;; + s) + shift; + wget -q -O - "http://$1/solr/select?q=text_t:$2&start=0&rows=100&fl=sku&wt=rss" | awk '/^/{ gsub("","" );gsub("<\/link>","" ); print $0 }' + ;; + esac + done +else + echo "Neither curl nor wget installed!" + exit 1 +fi + diff --git a/bin/searchall.sh b/bin/searchall.sh new file mode 100755 index 000000000..39ef07c3c --- /dev/null +++ b/bin/searchall.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd "`dirname $0`" +port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) +./searchall1.sh -s localhost:$port $1 \ No newline at end of file diff --git a/bin/searchall1.sh b/bin/searchall1.sh new file mode 100755 index 000000000..807d782d6 --- /dev/null +++ b/bin/searchall1.sh @@ -0,0 +1,4 @@ +TMPFILE=`mktemp -t search` || exit 1 +for address in `./up1.sh $1`; do sleep 0.01; ./search1.sh -s $address $2 >> $TMPFILE & done +sleep 2 +cat $TMPFILE \ No newline at end of file diff --git a/bin/up.sh b/bin/up.sh index 57ade3959..2a57b6eb6 100755 --- a/bin/up.sh +++ b/bin/up.sh @@ -1,11 +1,5 @@ #!/bin/bash cd "`dirname $0`" port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) -if which curl &>/dev/null; then - curl -s "http://localhost:$port/Network.xml?page=1&ip=" | awk '/
/{ gsub("
","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'; -elif which wget &>/dev/null; then - wget -q -O - "http://localhost:$port/Network.xml?page=1&ip=" | awk '/
/{ gsub("
","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'; -else - exit 1 -fi +./up1.sh localhost:$port diff --git a/bin/up1.sh b/bin/up1.sh new file mode 100755 index 000000000..17d88cc39 --- /dev/null +++ b/bin/up1.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cd "`dirname $0`" +if which curl &>/dev/null; then + curl -s "http://$1/Network.xml?page=1&ip=" | awk '/
/{ gsub("
","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'; +elif which wget &>/dev/null; then + wget -q -O - "http://$1/Network.xml?page=1&ip=" | awk '/
/{ gsub("
","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'; +else + exit 1 +fi +