diff options
-rw-r--r-- | pacman2pacman-get | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pacman2pacman-get b/pacman2pacman-get index 46d3319..dd18bb9 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -129,12 +129,19 @@ then # We need to find out the length of the ${url} var. len="${#url}" - sed "s#url-listl[[:digit:]]\+.\+.pkg.tar.xz#url-listl${len}:${url}#" < "${torrent_folder}/${url##*/}.torrent" > "${torrent_folder}/${url##*/}.torrent.modified" + sed "s#url-list[[:digit:]]\+.\+.pkg.tar.xz#url-list${len}:${url}#" < "${torrent_folder}/${url##*/}.torrent" > "${torrent_folder}/${url##*/}.torrent.modified" mv "${torrent_folder}/${url##*/}.torrent.modified" "${torrent_folder}/${url##*/}.torrent" transmission_output=$(mktemp) - + + # If the torrent is already in transmission we remove it because + # we want it to be fresh (with current webseed list etc) + if id=$(transmission-remote -l | grep "${url##*/}") + then + transmission-remote -t "${id}" -r + fi + # Add the torrent to transmission (( debugmode )) && transmission-remote -a "${torrent_folder}/${url##*/}.torrent" -w "${pkg_cache_location}" 2>&1 | tee "${transmission_output}" (( debugmode )) || transmission-remote -a "${torrent_folder}/${url##*/}.torrent" -w "${pkg_cache_location}" 2>&1 > "${transmission_output}" |