mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-18 22:21:55 +03:00
48fa4e116c
If the user is using a pre-existing config, don't update the legal notice. PR #16974.
21 lines
681 B
Bash
Executable file
21 lines
681 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ ! -f /config/qBittorrent/qBittorrent.conf ]; then
|
|
mkdir -p /config/qBittorrent/
|
|
cat << EOF > /config/qBittorrent/qBittorrent.conf
|
|
[BitTorrent]
|
|
Session\DefaultSavePath=/downloads
|
|
Session\TempPath=/downloads/temp
|
|
|
|
[LegalNotice]
|
|
Accepted=false
|
|
EOF
|
|
|
|
if [ "$LEGAL" = "accept" ] ; then
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' /config/qBittorrent/qBittorrent.conf
|
|
else
|
|
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' /config/qBittorrent/qBittorrent.conf
|
|
fi
|
|
fi
|
|
|
|
HOME="/config" XDG_CONFIG_HOME="/config" XDG_DATA_HOME="/data" qbittorrent-nox --webui-port=$WEBUI_PORT
|