完善应用安装

Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
2025-01-26 14:14:57 +08:00
parent c55a4172c4
commit 17395a162b
2 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -16,14 +16,14 @@ if [ -f .env ]; then
mkdir -p "$TRANSMISSION_ROOT_PATH/watch"
# setup-2 install theme
if [ ! -d "$TRANSMISSION_ROOT_PATH/themes" ]; then
mkdir -p "$TRANSMISSION_ROOT_PATH/themes"
if [ ! -d "$TRANSMISSION_ROOT_PATH/ui/themes" ]; then
mkdir -p "$TRANSMISSION_ROOT_PATH/ui/themes"
if command -v unzip >/dev/null 2>&1; then
unzip -o themes/flood-for-transmission.zip -d "$TRANSMISSION_ROOT_PATH/themes"
unzip -o themes/flood-for-transmission.zip -d "$TRANSMISSION_ROOT_PATH/ui/themes"
UNZIP_SUCCESS=$?
elif command -v tar >/dev/null 2>&1; then
tar -xf themes/flood-for-transmission.zip -C "$TRANSMISSION_ROOT_PATH/themes"
tar -xf themes/flood-for-transmission.zip -C "$TRANSMISSION_ROOT_PATH/ui/themes"
UNZIP_SUCCESS=$?
else
echo "Warning: Neither 'unzip' nor 'tar' is installed. Skipping theme extraction."
@@ -34,9 +34,9 @@ if [ -f .env ]; 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
sed -i 's|^TRANSMISSION_WEB_HOME=.*|TRANSMISSION_WEB_HOME=/ui/themes/flood-for-transmission|' .env
else
echo "TRANSMISSION_WEB_HOME=/themes/flood-for-transmission" >> .env
echo "TRANSMISSION_WEB_HOME=/ui/themes/flood-for-transmission" >> .env
fi
else
echo "Warning: Failed to extract the theme archive. Proceeding without extracted theme."