summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Christen <Orbiter@users.noreply.github.com>2026-04-21 11:08:22 +0200
committerGitHub <noreply@github.com>2026-04-21 11:08:22 +0200
commit43460ae1bd7f7c8be99e0d61a185016da396dfe1 (patch)
treeb8852fcad3455f708f0bc2f680b30313e0ec5d7d
parent7b303b6f82b1eee57c05e984ce7f4f42fc992405 (diff)
parent8a1756d2df8c57dad4b22744be9718a359d372bb (diff)
Merge pull request #770 from songproducer/fix/conf-comment-parser
fix: ignore comment lines when reading yacy.conf keys in startYACY.sh…
-rwxr-xr-xstartYACY.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/startYACY.sh b/startYACY.sh
index 14750d8ca..3b19fcefb 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -197,20 +197,20 @@ then
if [ -z "$YACY_JAVASTART_XMX" ]
then
# When YACY_JAVASTART_XMX is not set or empty:
- # Read from $CONFIGFILE
- j="`grep javastart_Xmx "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ # Read from $CONFIGFILE (strip comment lines first to avoid matching #javastart_Xmx=...)
+ j="`grep -v '^\s*#' "$CONFIGFILE" | grep 'javastart_Xmx' | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
else
# use the YACY_JAVASTART_XMX variable
JAVA_ARGS="-$YACY_JAVASTART_XMX $JAVA_ARGS"
fi
- # Priority
- j="`grep javastart_priority "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ # Priority (strip comment lines first)
+ j="`grep -v '^\s*#' "$CONFIGFILE" | grep 'javastart_priority' | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA="nice -n $j $JAVA"; fi;
- PORT="`grep ^port= "$CONFIGFILE" | sed 's/^[^=]*=//'`";
+ PORT="`grep -v '^\s*#' "$CONFIGFILE" | grep '^port=' | sed 's/^[^=]*=//'`";
if [ -z "$PORT" ]; then PORT="8090"; fi;
# for i in `grep javastart "$CONFIGFILE"`;do