summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Graham <joseph@fibreglass.tunachunks>2014-06-17 13:40:12 +0100
committerJoseph Graham <joseph@fibreglass.tunachunks>2014-06-17 13:40:12 +0100
commit2c3c9d8d0b130500fd5d36a7a55e773d6527aec6 (patch)
tree97c505ac222a9752548fc3b925743090535ba20e
parentb47e77a0107fc10cafd25c42f72c807e9990f1b7 (diff)
If a webseed is dead and there are no peers it will abort
-rw-r--r--pacman2pacman-get36
1 files 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