2022-04-25 06:39:25 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
profilePath="/config"
|
|
|
|
qbtConfigFile="$profilePath/qBittorrent/config/qBittorrent.conf"
|
|
|
|
|
|
|
|
if [ ! -f "$qbtConfigFile" ]; then
|
|
|
|
mkdir -p "$(dirname $qbtConfigFile)"
|
|
|
|
cat << EOF > "$qbtConfigFile"
|
2022-04-25 06:39:25 +03:00
|
|
|
[BitTorrent]
|
|
|
|
Session\DefaultSavePath=/downloads
|
2022-05-05 06:02:57 +03:00
|
|
|
Session\Port=6881
|
2022-04-25 06:39:25 +03:00
|
|
|
Session\TempPath=/downloads/temp
|
|
|
|
|
|
|
|
[LegalNotice]
|
|
|
|
Accepted=false
|
|
|
|
EOF
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
if [ "$QBT_EULA" = "accept" ]; then
|
|
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
|
2022-05-04 07:12:15 +03:00
|
|
|
else
|
2022-05-05 06:02:57 +03:00
|
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
|
2022-05-04 07:12:15 +03:00
|
|
|
fi
|
2022-04-25 06:39:25 +03:00
|
|
|
fi
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
qbittorrent-nox \
|
|
|
|
--profile="$profilePath" \
|
|
|
|
--webui-port="$QBT_WEBUI_PORT" \
|
|
|
|
"$@"
|