From 1998ef06d61f85bbdc879adc3731bb16c60d2d34 Mon Sep 17 00:00:00 2001 From: Cp0204 Date: Sun, 5 May 2024 18:20:36 +0800 Subject: [PATCH] Adaptation ZimaOS --- app/run.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/run.sh b/app/run.sh index 634c852..f84ea2a 100644 --- a/app/run.sh +++ b/app/run.sh @@ -6,7 +6,14 @@ mod_dir="${config_dir}/mod" mod_store_dir="${config_dir}/mod_store" icon_dir="${config_dir}/icon" -www_dir="/var/lib/casaos/www" +# Judgment in CasaOS or ZimaOS +if [[ -f "/var/lib/casaos/www/index.html" ]]; then + www_dir="/var/lib/casaos/www" + echo "Running on: CasaOS" +elif [[ -f "/usr/share/casaos/www/index.html" ]]; then + www_dir="/usr/share/casaos/www" + echo "Running on: ZimaOS" +fi index_html="${www_dir}/index.html" index_html_bak="${index_html}.bak" @@ -18,7 +25,7 @@ start() { echo "Creating directory ${mod_store_dir}" mkdir -p "$mod_store_dir" cp -r /app/mod/* "$mod_store_dir" - echo -e "Delete this folder and it will be recreated when the new version of the container is started.\n删除本文件夹,新版本容器启动时将重建。" >> "${mod_store_dir}/Get_New_MODs.txt" + echo -e "Delete this folder and it will be recreated when the new version of the container is started.\n删除本文件夹,新版本容器启动时将重建。" >>"${mod_store_dir}/Get_New_MODs.txt" fi # Process mapping directory