summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2018-11-27 11:36:40 +0100
committerluccioman <luccioman@users.noreply.github.com>2018-11-27 11:36:40 +0100
commit106bfd0e5f7cc9cabf32a5c2110db44e9200bdd3 (patch)
tree3959236abc4ca5b8fb2e529e38d42c7909b73c9e
parent17ad1f7e65475f6f5de96f69e74c938fac699768 (diff)
Also check yacy.conf file existence in shell scripts where relevant
-rwxr-xr-xbin/apicall.sh1
-rwxr-xr-xbin/apicat.sh1
-rw-r--r--bin/checkConfFile.sh8
-rwxr-xr-xbin/down.sh1
-rwxr-xr-xbin/graphicstest.sh1
-rwxr-xr-xbin/protectedPostApiCall.sh1
-rwxr-xr-xbin/search.sh1
-rwxr-xr-xbin/searchall.sh1
8 files changed, 15 insertions, 0 deletions
diff --git a/bin/apicall.sh b/bin/apicall.sh
index a8e797560..bfdcbc680 100755
--- a/bin/apicall.sh
+++ b/bin/apicall.sh
@@ -15,6 +15,7 @@
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
admin=$(grep ^adminAccountUserName= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
diff --git a/bin/apicat.sh b/bin/apicat.sh
index 31659e320..512ba04ee 100755
--- a/bin/apicat.sh
+++ b/bin/apicat.sh
@@ -17,6 +17,7 @@
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
admin=$(grep ^adminAccountUserName= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
diff --git a/bin/checkConfFile.sh b/bin/checkConfFile.sh
new file mode 100644
index 000000000..9aa86e7de
--- /dev/null
+++ b/bin/checkConfFile.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env sh
+# Check that a yacy configuration file exists under the DATA folder set by the variable YACY_DATA_PATH
+# Exits with an error message and status 2 when the file is not found or is not a regular file
+
+if [ ! -f "$YACY_DATA_PATH/SETTINGS/yacy.conf" ]; then
+ echo "No YaCy configuration file found at $YACY_DATA_PATH/SETTINGS/yacy.conf"
+ exit 2
+fi \ No newline at end of file
diff --git a/bin/down.sh b/bin/down.sh
index 994981cf1..38134ba31 100755
--- a/bin/down.sh
+++ b/bin/down.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
diff --git a/bin/graphicstest.sh b/bin/graphicstest.sh
index 7467df984..ce0129259 100755
--- a/bin/graphicstest.sh
+++ b/bin/graphicstest.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
while [ 1 = 1 ]
diff --git a/bin/protectedPostApiCall.sh b/bin/protectedPostApiCall.sh
index a230754ab..106884122 100755
--- a/bin/protectedPostApiCall.sh
+++ b/bin/protectedPostApiCall.sh
@@ -16,6 +16,7 @@
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
admin=$(grep ^adminAccountUserName= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
diff --git a/bin/search.sh b/bin/search.sh
index bec3e78e7..ec34819bf 100755
--- a/bin/search.sh
+++ b/bin/search.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
./search1.sh -y localhost:$port "$1" \ No newline at end of file
diff --git a/bin/searchall.sh b/bin/searchall.sh
index 540b0703d..64a59561e 100755
--- a/bin/searchall.sh
+++ b/bin/searchall.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
cd "`dirname $0`"
. ./checkDataFolder.sh
+. ./checkConfFile.sh
port=$(grep ^port= "$YACY_DATA_PATH/SETTINGS/yacy.conf" |cut -d= -f2)
./searchall1.sh -s localhost:$port $1 \ No newline at end of file