diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh b/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh index ab07585a2..6fb9eed6b 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh @@ -19,10 +19,19 @@ if bashio::config.true "qbit_manage"; then # Set qBittorrent options echo "... align QBT username and password" - sed -i "/host:/c\ host: \"localhost:8080\"" /config/qbit_manage/qbit_manage.yml - sed -i "/user:/c\ user: \"$(bashio::config "QBT_USERNAME")\"" /config/qbit_manage/qbit_manage.yml - sed -i "s=root_dir: \"/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml - sed -i "s=remote_dir: \"/mnt/user/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml + # qBittorrent path to local + echo "... default url set to 127.0.0.1, change manually if you have an external qbt system" + sed -i "s/localhost/127.0.0.1/g" /config/qbit_manage/qbit_manage.yml + # Set password from options + echo "... setting username to the addon options one" + sed -i "/user:/c\ user: '$(bashio::config 'Username')'" /config/qbit_manage/qbit_manage.yml + # If password is default, correct + echo "... default password set to homeassistant, change manually in the file if not" + sed -i "/pass: password/c\ pass: homeassistant" /config/qbit_manage/qbit_manage.yml + # Set root dir + echo "... downloads directory set to $(bashio::config 'SavePath')" + sed -i "/^root_dir/d" /config/qbit_manage/qbit_manage.yml + sed -i "/directory:/a\ root_dir: \"$(bashio::config 'SavePath')\"" # Startup delay 30s ; config file specific ; log file specific python /qbit_manage/qbit_manage.py -sd 30 --config-file "/config/qbit_manage/qbit_manage.yml" --log-file "/config/qbit_manage/qbit_manage.log" --run & true