summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorokybaca <klokanek@eldar.cz>2024-12-13 02:09:55 +0100
committerokybaca <klokanek@eldar.cz>2024-12-13 02:09:55 +0100
commit4b6ec7a13177793880a2bf17fa77c504dd7eedc2 (patch)
tree4e254e949f6e964bf98d33d5eb379abb49b8490d
parent3ede322f5e25ea90f3865b4542ceb276d969491f (diff)
if java executable not found using 'which', try to use 'command'
-rwxr-xr-xstartYACY.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/startYACY.sh b/startYACY.sh
index 3ee15d88b..e1cac6ba5 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -20,16 +20,24 @@ else
ID="id"
fi
+# if java executable not found using 'which', let's try 'command'
+if [ ! -x "$JAVA" ]
+then
+ JAVA="`command -v java`"
+fi
+
if [ ! -x "$JAVA" ]
then
echo "The java command is not executable."
- echo "Either you have not installed java or it is not in your PATH"
+ echo "Either you have not installed java or it is not in your PATH."
+ echo "You can also set a path to java manually, in \$JAVA option of $0 script."
#Cron supports setting the path in
#echo "Has this script been invoked by CRON?"
#echo "if so, please set PATH in the crontab, or set the correct path in the variable in this script."
exit 1
fi
+
usage() {
cat - <<USAGE
startscript for YaCy on UNIX-like systems