From ba4868a068c03cd1e024279b23678e275aab02c2 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Tue, 12 Mar 2024 16:16:23 +0100 Subject: [PATCH] Fixed start.sh to apply RT settings once only Signed-off-by: Janos SUTO --- docker/start.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/start.sh b/docker/start.sh index e7445118..85762762 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -131,7 +131,14 @@ fix_configs() { if [[ $RT -eq 1 ]]; then sed -i "s/define('RT', 0)/define('RT', 1)/" "$SPHINX_CONF" - echo "\$config['RT'] = 1;" >> "$CONFIG_SITE_PHP" + if ! grep "'RT'" "$CONFIG_SITE_PHP"; then + echo "\$config['RT'] = 1;" >> "$CONFIG_SITE_PHP" + fi + + if ! grep "'SPHINX_MAIN_INDEX'" "$CONFIG_SITE_PHP"; then + echo "\$config['SPHINX_MAIN_INDEX'] = 'piler1';" >> "$CONFIG_SITE_PHP" + fi + sed -i "s%rtindex=.*%rtindex=1%" "$PILER_CONF" fi }