mirror of
https://github.com/qbittorrent/docker-qbittorrent-nox.git
synced 2024-11-26 19:00:33 +00:00
Add backward compatibility for environment variable
The new `QBT_LEGAL_NOTICE` variable will obsolete `QBT_EULA`. Its appearance (and therefore documentation) is scheduled at the next major qbt release.
This commit is contained in:
parent
f0f3c8d71b
commit
e538c1bd8f
@ -37,11 +37,18 @@ Accepted=false
|
||||
EOF
|
||||
fi
|
||||
|
||||
_eula=$(echo "$QBT_EULA" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_eula" = "accept" ]; then
|
||||
_legalNotice=$(echo "$QBT_LEGAL_NOTICE" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_legalNotice" = "confirm" ]; then
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
||||
else
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
||||
# for backward compatibility
|
||||
# TODO: remove in next major version release
|
||||
_eula=$(echo "$QBT_EULA" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_eula" = "accept" ]; then
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
||||
else
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$QBT_WEBUI_PORT" ]; then
|
||||
|
@ -37,11 +37,18 @@ Accepted=false
|
||||
EOF
|
||||
fi
|
||||
|
||||
_eula=$(echo "$QBT_EULA" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_eula" = "accept" ]; then
|
||||
_legalNotice=$(echo "$QBT_LEGAL_NOTICE" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_legalNotice" = "confirm" ]; then
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
||||
else
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
||||
# for backward compatibility
|
||||
# TODO: remove in next major version release
|
||||
_eula=$(echo "$QBT_EULA" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$_eula" = "accept" ]; then
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
||||
else
|
||||
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$QBT_WEBUI_PORT" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user