mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-08 16:45:56 +02:00
Allow SavePath for 4.4.1
This commit is contained in:
@@ -27,22 +27,27 @@ fi
|
|||||||
# Default folder #
|
# Default folder #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
|
# Set variable
|
||||||
|
DOWNLOADS=$(bashio::config 'SavePath')
|
||||||
|
|
||||||
|
# Set configuration
|
||||||
if bashio::config.has_value 'SavePath'; then
|
if bashio::config.has_value 'SavePath'; then
|
||||||
DOWNLOADS=$(bashio::config 'SavePath')
|
|
||||||
#sed -i '/DefaultSavePath/d' qBittorrent.conf
|
# Replace save path
|
||||||
#sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf
|
|
||||||
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 "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf
|
||||||
#sed -i '/SavePath/d' qBittorrent.conf
|
|
||||||
#sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf
|
# Replace session save path
|
||||||
mkdir -p "$DOWNLOADS" || bashio::log.fatal "Error : folder defined in SavePath doesn't exist and can't be created. Check path"
|
CURRENTSAVEPATH=$(sed -n '/Session\\DefaultSavePath/p' qBittorrent.conf)
|
||||||
chown -R abc:abc "$DOWNLOADS" || bashio::log.fatal "Error, please check default save folder configuration in addon"
|
sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf
|
||||||
|
|
||||||
|
# Info
|
||||||
bashio::log.info "Downloads can be found in $DOWNLOADS"
|
bashio::log.info "Downloads can be found in $DOWNLOADS"
|
||||||
else
|
|
||||||
mkdir -p /share/qBittorrent || true
|
|
||||||
chown -R abc:abc /share/qBittorrent
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create default location
|
||||||
|
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"
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Avoid bugs #
|
# Avoid bugs #
|
||||||
|
|||||||
Reference in New Issue
Block a user