Skip to content

Commit

Permalink
Changes to improve compatibility with OpenBSD. (see
Browse files Browse the repository at this point in the history
  • Loading branch information
marcnause committed Feb 23, 2015
1 parent ba276d3 commit 53e4ae6
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bin/addrss.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/Load_RSS_p.html?indexAllItemContent=&repeat=off&url=$1" > /dev/null ./apicall.sh "/Load_RSS_p.html?indexAllItemContent=&repeat=off&url=$1" > /dev/null
2 changes: 1 addition & 1 deletion bin/apicall.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
admin=$(grep ^adminAccountUserName= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) admin=$(grep ^adminAccountUserName= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
Expand Down
2 changes: 1 addition & 1 deletion bin/apicat.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
pw=$(grep ^adminAccountBase64MD5= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) pw=$(grep ^adminAccountBase64MD5= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
Expand Down
2 changes: 1 addition & 1 deletion bin/checkalive.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"


# for a production environment with high-availability requirement, # for a production environment with high-availability requirement,
Expand Down
2 changes: 1 addition & 1 deletion bin/checkindex.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`/.." cd "`dirname $0`/.."
for i in DATA/INDEX/* ; do for i in DATA/INDEX/* ; do
if [ -d "$i" ]; then if [ -d "$i" ]; then
Expand Down
2 changes: 1 addition & 1 deletion bin/clearall.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=on" > /dev/null ./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=on" > /dev/null
2 changes: 1 addition & 1 deletion bin/clearapi.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/Tables_p.html?table=api&deletetable=all" > /dev/null ./apicall.sh "/Tables_p.html?table=api&deletetable=all" > /dev/null
2 changes: 1 addition & 1 deletion bin/clearcache.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deleteIndex=off&deleteSolr=off&deleteCache=on&deleteCrawlQueues=off&deleteRobots=on&deleteSearchFl=on&deletecomplete=" > /dev/null ./apicall.sh "/IndexControlURLs_p.html?deleteIndex=off&deleteSolr=off&deleteCache=on&deleteCrawlQueues=off&deleteRobots=on&deleteSearchFl=on&deletecomplete=" > /dev/null
2 changes: 1 addition & 1 deletion bin/clearindex.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=off" > /dev/null ./apicall.sh "/IndexControlURLs_p.html?deletecomplete=&deleteIndex=on&deleteSolr=on&deleteCrawlQueues=on&deleteRobots=on&deleteSearchFl=on&deleteCache=off" > /dev/null
2 changes: 1 addition & 1 deletion bin/deleteurl.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.html?urlhashdeleteall=&urlstring=$1" > /dev/null ./apicall.sh "/IndexControlURLs_p.html?urlhashdeleteall=&urlstring=$1" > /dev/null
2 changes: 1 addition & 1 deletion bin/deploy.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
cd .. cd ..
./stopYACY.sh ./stopYACY.sh
Expand Down
2 changes: 1 addition & 1 deletion bin/down.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
if which curl &>/dev/null; then if which curl &>/dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion bin/dumpcheck.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
java -ea -cp ../classes:../lib/yacycore.jar net.yacy.kelondro.logging.ThreadDump -f $1 java -ea -cp ../classes:../lib/yacycore.jar net.yacy.kelondro.logging.ThreadDump -f $1
2 changes: 1 addition & 1 deletion bin/importmediawiki.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh /IndexImportMediawiki_p.html?file=$1 > /dev/null ./apicall.sh /IndexImportMediawiki_p.html?file=$1 > /dev/null
2 changes: 1 addition & 1 deletion bin/importurllist.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" 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 ./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
2 changes: 1 addition & 1 deletion bin/indexdump.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.xml?indexdump=" | awk '/<dumpfile>/{ gsub("<dumpfile>","" );gsub("<\/dumpfile>","" ); print $0 }' | awk '{print $1}'; ./apicall.sh "/IndexControlURLs_p.xml?indexdump=" | awk '/<dumpfile>/{ gsub("<dumpfile>","" );gsub("<\/dumpfile>","" ); print $0 }' | awk '{print $1}';
2 changes: 1 addition & 1 deletion bin/indexrestore.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/IndexControlURLs_p.xml?indexrestore=&dumpfile=$1" > /dev/null ./apicall.sh "/IndexControlURLs_p.xml?indexrestore=&dumpfile=$1" > /dev/null
2 changes: 1 addition & 1 deletion bin/myip.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/yacy/seedlist.xml?my=" | awk '/<IP>/{ gsub("<IP>","" );gsub("<\/IP>","" ); print $0 }' | awk '{print $1}'; ./apicall.sh "/yacy/seedlist.xml?my=" | awk '/<IP>/{ gsub("<IP>","" );gsub("<\/IP>","" ); print $0 }' | awk '{print $1}';
2 changes: 1 addition & 1 deletion bin/passwd.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/ConfigAccounts_p.html?setAdmin=&adminuser=admin&adminpw1=$1&adminpw2=$1&access=" > /dev/null ./apicall.sh "/ConfigAccounts_p.html?setAdmin=&adminuser=admin&adminpw1=$1&adminpw2=$1&access=" > /dev/null
echo "Password for User Name 'admin' set to '$1'" echo "Password for User Name 'admin' set to '$1'"
2 changes: 1 addition & 1 deletion bin/search.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
./search1.sh -y localhost:$port "$1" ./search1.sh -y localhost:$port "$1"
2 changes: 1 addition & 1 deletion bin/search1.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
if which curl &>/dev/null; then if which curl &>/dev/null; then
while getopts "ys" opt; do while getopts "ys" opt; do
Expand Down
2 changes: 1 addition & 1 deletion bin/searchall.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
./searchall1.sh -s localhost:$port $1 ./searchall1.sh -s localhost:$port $1
2 changes: 1 addition & 1 deletion bin/up.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
cd "`dirname $0`" cd "`dirname $0`"
./apicall.sh "/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}'; ./apicall.sh "/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';


Expand Down
16 changes: 14 additions & 2 deletions startYACY.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ USAGE
#startup YaCy #startup YaCy
cd "`dirname $0`" 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 if [ $? -ne 0 ];then

exit 1; exit 1;
fi fi


Expand Down Expand Up @@ -87,7 +99,7 @@ for option in $options;do
-t|--tail-log) -t|--tail-log)
TAILLOG=1 TAILLOG=1
;; ;;
-gui) -g|--gui)
GUI=1 GUI=1
isparameter=1 isparameter=1
;; ;;
Expand Down

0 comments on commit 53e4ae6

Please sign in to comment.