mirror of
https://gitlab.com/Bockiii/deemix-docker.git
synced 2024-08-30 17:32:18 +00:00
30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
#!/usr/bin/with-contenv bash
|
|
|
|
# install deemix
|
|
|
|
if [ -f "/deemix/updated" ]; then
|
|
echo "[cont-init.d] Installing"
|
|
cd /deemix
|
|
pip3 install -U -r server-requirements.txt --quiet --disable-pip-version-check
|
|
rm /deemix/updated
|
|
echo "[cont-init.d] Installation done"
|
|
fi
|
|
|
|
# check for arl environment variable. if it is set, create the arl file.
|
|
# if the arl was previously set but is out of date, update the file with the arl from the env variable
|
|
|
|
if [ ${#ARL} -gt 10 ]; then
|
|
# this file might not exist; happens when the users runs for the first time
|
|
OLDARL=$(cat /config/.arl 2>/dev/null || echo 0) # ignore if the file doesn't exist
|
|
if [ "$ARL" != "$OLDARL" ]; then
|
|
echo "[cont-init.d] !!! ARL from environment variable does not match current ARL. Using environment variable. !!!"
|
|
echo "[cont-init.d] !!! Please update your ARL in the variable instead of the webinterface or remove the ARL from the container call. !!!"
|
|
printf $ARL > /config/.arl
|
|
fi
|
|
fi
|
|
|
|
# Fix misconfigured download locations. The container's download map is always /downloads.
|
|
if [ -f "/config/config.json" ]; then
|
|
jq '.downloadLocation = "/downloads"' /config/config.json > tmp.$$.json && mv tmp.$$.json /config/config.json
|
|
chown abc:abc /config/config.json
|
|
fi |