Update 91-qbittorrent_configuration.sh

This commit is contained in:
Alexandre
2022-12-07 22:43:02 +01:00
committed by GitHub
parent 9ef5255954
commit 1c3ff4c7c9

View File

@@ -39,15 +39,14 @@ if bashio::config.has_value 'SavePath'; then
DOWNLOADS=$(bashio::config 'SavePath')
# Replace save path
CURRENTSAVEPATH=$(sed -n '/Downloads\SavePath/p' qBittorrent.conf)
CURRENTSAVEPATH=$(sed -n '/Downloads\\SavePath/p' qBittorrent.conf)
sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf || \
sed -i "${LINE}a Downloads\SavePath=$DOWNLOADS" qBittorrent.conf
sed -i "${LINE}a Downloads\\SavePath=$DOWNLOADS" qBittorrent.conf
# Replace session save path
CURRENTSAVEPATH=$(sed -n '/Session\DefaultSavePath/p' qBittorrent.conf)
CURRENTSAVEPATH=$(sed -n '/Session\\DefaultSavePath/p' qBittorrent.conf)
sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf || \
sed -i "1a [BitTorrent]" qBittorrent.conf;
sed -i "2a Session\DefaultSavePath=$DOWNLOADS" qBittorrent.conf
sed -i "2a Session\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf
# Info
bashio::log.info "Downloads can be found in $DOWNLOADS"