From 2c3c9d8d0b130500fd5d36a7a55e773d6527aec6 Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Tue, 17 Jun 2014 13:40:12 +0100 Subject: If a webseed is dead and there are no peers it will abort --- pacman2pacman-get | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/pacman2pacman-get b/pacman2pacman-get index 3610fee..f6ad9eb 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -175,16 +175,32 @@ then if ! $(curl -IL "${url}" | grep '200 OK' &>/dev/null) then # The webseed seems to be invalid so we print an error - # message and exit. - - progress='0.0% Warning: Webseed dead...' # This most - # likely means - # the user - # needs to run - # pacman -Sy, - # or that their - # internet is - # down. + # message. + + progress='0.0% Warning: Webseed dead...' # This + # most + # likely + # means + # the + # user + # needs + # to run + # pacman + # -Sy, or + # that + # their + # internet + # is + # down. + + # If there are no peers we remove the torrent from + # transmission, print an error message and exit. + if (( $(transmission-remote -t "${id}" -pi | wc -l) < 2 )) + transmission-remote -t "${id}" -r + echo "Webseed dead and no peers, removing torrent from transmission and exiting." + exit 1 + fi + last_webseed_check[0]="${count}" last_webseed_check[1]="broken" else -- cgit v1.2.2