From efd490dc76d96a0bdb783f23e44286d0089f34e5 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 7 Jun 2021 22:06:43 +0200 Subject: [PATCH] scan for threads in reverse order (prioritize newer threads) --- threadwatcher | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadwatcher b/threadwatcher index e642f87..d1251d8 100755 --- a/threadwatcher +++ b/threadwatcher @@ -34,8 +34,8 @@ scan(){ echo "no threads to watch over currently" exit fi - # READS URLFILE - while read -r line; do + + tac "$URLFILE" | while read -r line; do running_dls=0 url="$(echo "$line" | cut -f1)" dl_location="$(echo "$line" | cut -f2)" @@ -95,7 +95,7 @@ scan(){ fi done wait - done < "$URLFILE" + done mv "$TMP_URLFILE" "$URLFILE" rm /tmp/threadwatcher.lock }