more printout

This commit is contained in:
Alexander Bocken 2021-06-18 17:44:33 +02:00
parent 6fe5bbdd5c
commit 40af4955bb
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -40,6 +40,8 @@ makepathabsolute(){
} }
scan(){ scan(){
[ -f /tmp/threadwatcher.lock ] && [ "$(pgrep -c threadwatcher)" -gt 1 ] &&
echo "Threadwatcher already scanning... waiting for it to finish before rescanning."
while [ -f /tmp/threadwatcher.lock ] && [ "$(pgrep -c threadwatcher)" -gt 1 ]; do while [ -f /tmp/threadwatcher.lock ] && [ "$(pgrep -c threadwatcher)" -gt 1 ]; do
sleep 1 sleep 1
done done
@ -47,9 +49,9 @@ scan(){
touch /tmp/threadwatcher.lock touch /tmp/threadwatcher.lock
ping -q -c 1 4channel.org > /dev/null|| { echo "Cannot connect to 4chan."; exit 1;} ping -q -c 1 4channel.org > /dev/null|| { echo "Cannot connect to 4chan."; exit 1;}
if [ "$(wc -l < "$URLFILE")" -gt 0 ]; then if [ "$(wc -l < "$URLFILE")" -gt 0 ]; then
echo "scanning threads..." echo "Scanning threads..."
else else
echo "no threads to watch over currently" echo "No threads to watch over currently."
exit exit
fi fi