Skip to content

Commit

Permalink
Update the other qbittorrent script with the new variable.
Browse files Browse the repository at this point in the history
Switch shebang on the npm script
  • Loading branch information
GilbN committed Apr 16, 2024
1 parent 5e72e5b commit 1e97720
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/command/with-contenv bash
#!/bin/sh

This comment has been minimized.

Copy link
@aleeraser

aleeraser Apr 23, 2024

Why was this changed? There are many bash-isms in this file which are ignored or treated as errors in a POSIX sh shell.

This comment has been minimized.

Copy link
@GilbN

GilbN Apr 23, 2024

Author Collaborator

User complained that the script was broken when using it with jlesage/nginx-proxy-manager and replacing that made it work.

This comment has been minimized.

Copy link
@aleeraser

aleeraser Apr 23, 2024

I don't know about that particular container, but Nginx Proxy Manager already comes with an official docker image, and using /bin/sh breaks compatibility with it, since this file contains many bash-isms.

The proper solution would be to either fix all the bash-isms or to directly use /bin/bash.

This comment has been minimized.

Copy link
@GilbN

GilbN Apr 23, 2024

Author Collaborator

oh, I thought the other one was the official. I'll revert it


echo '--------------------------------------'
echo '| Nginx Proxy Manager theme.park Mod |'
Expand Down
12 changes: 11 additions & 1 deletion docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ if [ "${TP_DISABLE_THEME}" = true ]; then
exit 0
fi

if [ -z ${QBITTORRENT_VERSION+x} ]; then \
echo 'QBITTORRENT_VERSION not set. Using the latest stable.'
QBITTORRENT_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:qbittorrent-nox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' | sed 's/-.*//'); \
fi

if ! [[ -x "$(command -v git)" ]]; then
echo '--------------------------'
echo '| Installing git package |'
Expand All @@ -46,6 +52,7 @@ echo -e "Variables set:\\n\
'TP_DOMAIN'=${TP_DOMAIN}\\n\
'TP_COMMUNITY_THEME'=${TP_COMMUNITY_THEME}\\n\
'TP_SCHEME'=${TP_SCHEME}\\n\
'QBITTORRENT_VERSION'=${QBITTORRENT_VERSION}\\n\
'TP_THEME'=${TP_THEME}\\n"

# Set default
Expand Down Expand Up @@ -81,13 +88,16 @@ if [[ ! -d /themepark ]]; then
echo '| Downloading WebUI files from github |'
echo '---------------------------------------'
printf '\nDownloading qBittorrent to /temp\n'
git clone --depth 1 https://github.com/qbittorrent/qBittorrent /temp
echo 'Downloading WebUI for version:' "${QBITTORRENT_VERSION}"
git clone --depth 1 -b release-${QBITTORRENT_VERSION} https://github.com/qbittorrent/qBittorrent /temp

printf '\nDownload finished\n\n'
cp -a /temp/src/webui/www /themepark
cp -a /temp/src/icons/. /themepark/public/icons
cp -a /temp/src/icons/. /themepark/private/icons
printf '\nCopy finished\n\n'
rm -rf /temp
rm -rf /tmp/*
printf '\nCleanup finished\n\n'
fi

Expand Down

0 comments on commit 1e97720

Please sign in to comment.