Skip to content

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

Changes to improve compatibility with OpenBSD. (see http://forum.yacy-websuche.de/viewtopic.php?f=8&t=5503)

Marc Nause53e4ae65d0bc
diff --git a/bin/addrss.sh b/bin/addrss.sh
index 70209ef53..f4a923d33 100755
--- a/bin/addrss.sh
+++ b/bin/addrss.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/Load_RSS_p.html?indexAllItemContent=&repeat=off&url=$1" > /dev/null
diff --git a/bin/apicall.sh b/bin/apicall.sh
index 09400cbdb..d549e4282 100755
--- a/bin/apicall.sh
+++ b/bin/apicall.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
admin=$(grep ^adminAccountUserName= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
diff --git a/bin/apicat.sh b/bin/apicat.sh
index 130892ae0..309b0eb4f 100755
--- a/bin/apicat.sh
+++ b/bin/apicat.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
pw=$(grep ^adminAccountBase64MD5= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
diff --git a/bin/checkalive.sh b/bin/checkalive.sh
index 4ecda7b12..5650b16a0 100755
--- a/bin/checkalive.sh
+++ b/bin/checkalive.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
# for a production environment with high-availability requirement,
diff --git a/bin/checkindex.sh b/bin/checkindex.sh
index e8270bd4e..c93625080 100755
--- a/bin/checkindex.sh
+++ b/bin/checkindex.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`/.."
for i in DATA/INDEX/* ; do
if [ -d "$i" ]; then
diff --git a/bin/clearall.sh b/bin/clearall.sh
index f54923d33..17cb50e99 100755
--- a/bin/clearall.sh
+++ b/bin/clearall.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=on" > /dev/null
\ No newline at end of file
diff --git a/bin/clearapi.sh b/bin/clearapi.sh
index fe3554e12..b6af756c8 100755
--- a/bin/clearapi.sh
+++ b/bin/clearapi.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/Tables_p.html?table=api&deletetable=all" > /dev/null
\ No newline at end of file
diff --git a/bin/clearcache.sh b/bin/clearcache.sh
index 84e63ff63..906595bec 100755
--- a/bin/clearcache.sh
+++ b/bin/clearcache.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deleteIndex=off&deleteSolr=off&deleteCache=on&deleteCrawlQueues=off&deleteRobots=on&deleteSearchFl=on&deletecomplete=" > /dev/null
diff --git a/bin/clearindex.sh b/bin/clearindex.sh
index 2f4545aea..c32abf94a 100755
--- a/bin/clearindex.sh
+++ b/bin/clearindex.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=off" > /dev/null
diff --git a/bin/deleteurl.sh b/bin/deleteurl.sh
index 933e0d9fe..fd9949637 100755
--- a/bin/deleteurl.sh
+++ b/bin/deleteurl.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?urlhashdeleteall=&urlstring=$1" > /dev/null
diff --git a/bin/deploy.sh b/bin/deploy.sh
index 4d3d6b10f..164d96371 100755
--- a/bin/deploy.sh
+++ b/bin/deploy.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
cd ..
./stopYACY.sh
diff --git a/bin/down.sh b/bin/down.sh
index 787351bfe..a435840c0 100755
--- a/bin/down.sh
+++ b/bin/down.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
if which curl &>/dev/null; then
diff --git a/bin/dumpcheck.sh b/bin/dumpcheck.sh
index abb15fa04..a7a89d56b 100755
--- a/bin/dumpcheck.sh
+++ b/bin/dumpcheck.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
java -ea -cp ../classes:../lib/yacycore.jar net.yacy.kelondro.logging.ThreadDump -f $1
diff --git a/bin/importmediawiki.sh b/bin/importmediawiki.sh
index e30ace27b..b520dc321 100755
--- a/bin/importmediawiki.sh
+++ b/bin/importmediawiki.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh /IndexImportMediawiki_p.html?file=$1 > /dev/null
diff --git a/bin/importurllist.sh b/bin/importurllist.sh
index 29d46ba60..1aad6c6c7 100755
--- a/bin/importurllist.sh
+++ b/bin/importurllist.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/Crawler_p.html?bookmarkFolder=/crawlStart&crawlingDomMaxPages=10000&intention=&range=domain&indexMedia=on&recrawl=nodoubles&storeHTCache=on&sitemapURL=&repeat_time=7&crawlingQ=on&crawlingIfOlderUnit=day&cachePolicy=ifexist&indexText=on&crawlingMode=file&crawlingURL=http://&bookmarkTitle=&mustnotmatch=&crawlingstart=import&mustmatch=.*&crawlingIfOlderNumber=7&repeat_unit=seldays&crawlingDepth=0&crawlingFile=$1" > /dev/null
diff --git a/bin/indexdump.sh b/bin/indexdump.sh
index dc18d0d58..5756e2cb5 100755
--- a/bin/indexdump.sh
+++ b/bin/indexdump.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.xml?indexdump=" | awk '/<dumpfile>/{ gsub("<dumpfile>","" );gsub("<\/dumpfile>","" ); print $0 }' | awk '{print $1}';
\ No newline at end of file
diff --git a/bin/indexrestore.sh b/bin/indexrestore.sh
index 9ecdb8a92..232f11ba1 100755
--- a/bin/indexrestore.sh
+++ b/bin/indexrestore.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.xml?indexrestore=&dumpfile=$1" > /dev/null
diff --git a/bin/myip.sh b/bin/myip.sh
index 68d8ac569..ea4ca86d1 100755
--- a/bin/myip.sh
+++ b/bin/myip.sh
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/yacy/seedlist.xml?my=" | awk '/<IP>/{ gsub("<IP>","" );gsub("<\/IP>","" ); print $0 }' | awk '{print $1}';
diff --git a/bin/passwd.sh b/bin/passwd.sh
index 172f06006..7152dd515 100755
--- a/bin/passwd.sh
+++ b/bin/passwd.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/ConfigAccounts_p.html?setAdmin=&adminuser=admin&adminpw1=$1&adminpw2=$1&access=" > /dev/null
echo "Password for User Name 'admin' set to '$1'"
\ No newline at end of file
diff --git a/bin/search.sh b/bin/search.sh
index f8e6e12fd..9a8bc645e 100755
--- a/bin/search.sh
+++ b/bin/search.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
./search1.sh -y localhost:$port "$1"
\ No newline at end of file
diff --git a/bin/search1.sh b/bin/search1.sh
index b679e8e65..2a9c197ae 100755
--- a/bin/search1.sh
+++ b/bin/search1.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
if which curl &>/dev/null; then
while getopts "ys" opt; do
diff --git a/bin/searchall.sh b/bin/searchall.sh
index 31c56282e..86e9aa521 100755
--- a/bin/searchall.sh
+++ b/bin/searchall.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
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/up.sh b/bin/up.sh
index 895a0ea35..c0bbf41de 100755
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
cd "`dirname $0`"
./apicall.sh "/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
diff --git a/startYACY.sh b/startYACY.sh
index ec0bfca43..f9af34de7 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -45,8 +45,20 @@ USAGE
#startup YaCy
cd "`dirname $0`"
-options="`getopt -n YaCy -o h,d,l,p,t,g -l help,debug,logging,print-out,tail-log,gui -- $@`"
+if [ $OS = "OpenBSD" ]
+then
+ if [ $(echo $@ | grep -o "\-\-" | wc -l) -ne 0 ]
+ then
+ echo "WARNING: Unfortunately this script does not support long options in $OS."
+ fi
+
+ options="`getopt -n YaCy -o h,d,l,p,t,g -- $@`"
+else
+ options="`getopt -n YaCy -o h,d,l,p,t,g -l help,debug,logging,print-out,tail-log,gui -- $@`"
+fi
+
if [ $? -ne 0 ];then
+
exit 1;
fi
@@ -87,7 +99,7 @@ for option in $options;do
-t|--tail-log)
TAILLOG=1
;;
- -gui)
+ -g|--gui)
GUI=1
isparameter=1
;;