完善应用安装

Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
2025-01-26 13:43:30 +08:00
parent 7c51127515
commit 7545cdbb77
5 changed files with 38 additions and 1 deletions
+30
View File
@@ -10,6 +10,36 @@ if [ -f .env ]; then
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
# setup-2 install theme
if [ ! -d "$TRANSMISSION_ROOT_PATH/themes" ]; then
mkdir -p "$TRANSMISSION_ROOT_PATH/themes"
if command -v unzip >/dev/null 2>&1; then
unzip -o themes/flood-for-transmission.zip -d "$TRANSMISSION_ROOT_PATH/themes"
UNZIP_SUCCESS=$?
elif command -v tar >/dev/null 2>&1; then
tar -xf themes/flood-for-transmission.zip -C "$TRANSMISSION_ROOT_PATH/themes"
UNZIP_SUCCESS=$?
else
echo "Warning: Neither 'unzip' nor 'tar' is installed. Skipping theme extraction."
UNZIP_SUCCESS=1
fi
if [ $UNZIP_SUCCESS -eq 0 ]; then
echo "Theme successfully extracted."
if grep -q "^TRANSMISSION_WEB_HOME=" .env; then
sed -i 's|^TRANSMISSION_WEB_HOME=.*|TRANSMISSION_WEB_HOME=/themes/flood-for-transmission|' .env
else
echo "TRANSMISSION_WEB_HOME=/themes/flood-for-transmission" >> .env
fi
else
echo "Warning: Failed to extract the theme archive. Proceeding without extracted theme."
fi
else
echo "Themes directory already exists. Skipping extraction."
fi
echo "Check Finish."
else