diff --git a/Dockerfile b/Dockerfile index f3f418c..07777d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt update \ libboost-system-dev \ libssl-dev \ make \ - && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[0] .assets_url' | tr -d '"') \ + && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.name=="libtorrent-1.2.8") | .assets_url' | head -n 1 | tr -d '"') \ && LIBTORRENT_DOWNLOAD_URL=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .browser_download_url' | tr -d '"') \ && LIBTORRENT_NAME=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .name' | tr -d '"') \ && curl -o /opt/${LIBTORRENT_NAME} -L ${LIBTORRENT_DOWNLOAD_URL} \ diff --git a/openvpn/start.sh b/openvpn/start.sh index 1e7c558..db9f7ed 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -13,22 +13,6 @@ if [[ ! -z "${check_network}" ]]; then exit 1 fi -export INSTALL_PYTHON3=$(echo "${INSTALL_PYTHON3,,}") -if [[ $INSTALL_PYTHON3 == "yes" ]]; then - echo "[INFO] INSTALL_PYTHON3 defined as '${INSTALL_PYTHON3}'" | ts '%Y-%m-%d %H:%M:%.S' - if [ ! -e /usr/bin/python3 ]; then - echo "[INFO] Python3 not yet installed, installing..." | ts '%Y-%m-%d %H:%M:%.S' - apt -qq update \ - && apt -y install python3 \ - && apt-get clean \ - && apt -y autoremove \ - && rm -rf \ - /var/lib/apt/lists/* \ - /tmp/* \ - /var/tmp/* - fi -fi - export VPN_ENABLED=$(echo "${VPN_ENABLED}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') if [[ ! -z "${VPN_ENABLED}" ]]; then echo "[INFO] VPN_ENABLED defined as '${VPN_ENABLED}'" | ts '%Y-%m-%d %H:%M:%.S' diff --git a/qbittorrent/install-python3.sh b/qbittorrent/install-python3.sh new file mode 100644 index 0000000..1591b02 --- /dev/null +++ b/qbittorrent/install-python3.sh @@ -0,0 +1,14 @@ +#!/bin/bash +if [ ! -e /usr/bin/python3 ]; then + echo "[INFO] Python3 not yet installed, installing..." | ts '%Y-%m-%d %H:%M:%.S' + apt -qq update \ + && apt -y install python3 \ + && apt-get clean \ + && apt -y autoremove \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* +else + echo "[INFO] Python3 is already installed, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' +fi \ No newline at end of file diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 3e6836f..86bccf7 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -17,6 +17,11 @@ if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then chown ${PUID}:${PGID} /config/qBittorrent/config/qBittorrent.conf fi +export INSTALL_PYTHON3=$(echo "${INSTALL_PYTHON3,,}") +if [[ $INSTALL_PYTHON3 == "yes" ]]; then + /bin/bash /etc/qbittorrent/install-python3.sh +fi + # The mess down here checks if SSL is enabled. export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") if [[ ${ENABLE_SSL} == 'yes' ]]; then