luci-app-qbittorrent: fix setting download_dir
@@ -17,8 +17,7 @@ config_qbittorrent()
{ [ "$2" != "/etc" ] && [ "$2" != "/etc/" ]; } && ln -sf "/etc/qBittorrent/ipfilter.dat" "$2/qBittorrent/ipfilter.dat"
if [ -f "$2/qBittorrent/config/qBittorrent.conf" ]; then
sed -i 's/WebUI\\Port=[0-9]*/WebUI\\Port='"$port"'/g' "$2/qBittorrent/config/qBittorrent.conf"
- sed -i 's/Downloads\\SavePath=[a-z,/]*//g' "$2/qBittorrent/config/qBittorrent.conf"
- echo "Downloads\SavePath=$download_dir" >> "$2/qBittorrent/config/qBittorrent.conf"
+ sed -i "/Downloads\\\SavePath/c\Downloads\\\SavePath=$download_dir" "$2/qBittorrent/config/qBittorrent.conf"
else
cat >"$2/qBittorrent/config/qBittorrent.conf"<<EOF
[AutoRun]
