From 83440ccb4e3de23323b95541f5dfb84e6f0ebe28 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 10 Aug 2024 09:59:36 +0800 Subject: [PATCH] improve docker entry script to avoid custom_config.json rebuild --- docker-entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 48bc494..0fc9408 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,9 +5,12 @@ if [ -d "/var/www/machete/themes/${theme}/" ]; then ## 复制对应皮肤的配置文件 cd /var/www/machete/runtime/ - rm -f custom_config.json - cp "../conf/custom_config_${theme}.json" ./custom_config.json - chmod 777 custom_config.json + + ## 避免容器重启后重新生成配置文件 + if [ ! -f custom_config.json ]; then + cp "../conf/custom_config_${theme}.json" ./custom_config.json + chmod 777 custom_config.json + fi fi ## 启动samba