scan for threads in reverse order (prioritize newer threads)

This commit is contained in:
Alexander Bocken 2021-06-07 22:06:43 +02:00
parent 40693f42c9
commit efd490dc76
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -34,8 +34,8 @@ scan(){
echo "no threads to watch over currently" echo "no threads to watch over currently"
exit exit
fi fi
# READS URLFILE
while read -r line; do tac "$URLFILE" | while read -r line; do
running_dls=0 running_dls=0
url="$(echo "$line" | cut -f1)" url="$(echo "$line" | cut -f1)"
dl_location="$(echo "$line" | cut -f2)" dl_location="$(echo "$line" | cut -f2)"
@ -95,7 +95,7 @@ scan(){
fi fi
done done
wait wait
done < "$URLFILE" done
mv "$TMP_URLFILE" "$URLFILE" mv "$TMP_URLFILE" "$URLFILE"
rm /tmp/threadwatcher.lock rm /tmp/threadwatcher.lock
} }