mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-18 22:21:55 +03:00
4894578b72
* Improves code readability. * Improve documentation. * Fix "docker stop" doesn't terminate qbt gracefully which could lead to data corruption. * Provide correct/working bittorrent listening port by default. * Make use of qbt profile option instead of hacking environment variables. * Simplify build steps. PR #16976.
28 lines
707 B
Bash
Executable file
28 lines
707 B
Bash
Executable file
#!/bin/sh
|
|
|
|
profilePath="/config"
|
|
qbtConfigFile="$profilePath/qBittorrent/config/qBittorrent.conf"
|
|
|
|
if [ ! -f "$qbtConfigFile" ]; then
|
|
mkdir -p "$(dirname $qbtConfigFile)"
|
|
cat << EOF > "$qbtConfigFile"
|
|
[BitTorrent]
|
|
Session\DefaultSavePath=/downloads
|
|
Session\Port=6881
|
|
Session\TempPath=/downloads/temp
|
|
|
|
[LegalNotice]
|
|
Accepted=false
|
|
EOF
|
|
|
|
if [ "$QBT_EULA" = "accept" ]; then
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
|
else
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
|
fi
|
|
fi
|
|
|
|
qbittorrent-nox \
|
|
--profile="$profilePath" \
|
|
--webui-port="$QBT_WEBUI_PORT" \
|
|
"$@"
|