summaryrefslogtreecommitdiff
path: root/pacman2pacman-get
diff options
context:
space:
mode:
Diffstat (limited to 'pacman2pacman-get')
-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