Merge pull request #13 from DyonR/dev

Moved the Python installation to separate script
This commit is contained in:
DyonR 2020-08-31 04:32:05 +02:00 committed by GitHub
commit f1a8b57539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 17 deletions

View File

@ -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} \

View File

@ -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'

View File

@ -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

View File

@ -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