diff --git a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh index ba1366d7b..278232b93 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh @@ -31,16 +31,16 @@ if bashio::config.has_value 'SavePath'; then DOWNLOADS=$(bashio::config 'SavePath') #sed -i '/DefaultSavePath/d' qBittorrent.conf #sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf - sed -i '/SavePath/d' qBittorrent.conf - sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf + CURRENTSAVEPATH=$(sed -n '/Downloads\\SavePath/p' qBittorrent.conf) + sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf + #sed -i '/SavePath/d' qBittorrent.conf + #sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf mkdir -p "$DOWNLOADS" || bashio::log.fatal "Error : folder defined in SavePath doesn't exist and can't be created. Check path" chown -R abc:abc "$DOWNLOADS" || bashio::log.fatal "Error, please check default save folder configuration in addon" bashio::log.info "Downloads can be found in $DOWNLOADS" - else mkdir -p /share/qBittorrent || true chown -R abc:abc /share/qBittorrent - fi