From 74c7947ae2883e1f8cc3a62f8da75fe0d0490045 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 13 Jul 2021 11:06:05 +0200 Subject: [PATCH] added AUTORM option --- threadwatcher | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/threadwatcher b/threadwatcher index a96d393..c069e98 100755 --- a/threadwatcher +++ b/threadwatcher @@ -6,6 +6,7 @@ #*/10 * * * * /usr/bin/threadwatcher scan THREADWATCHER_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/threadwatcher URLFILE="$THREADWATCHER_DIR/threads" +AUTORM=true #automatically removes ended thread from threads list. Unreliable internet connections can mess up threads list. TMP_URLFILE=/tmp/4chan_thread_watcher_tmp$$ [ -d "$THREADWATCHER_DIR" ] || mkdir -p "$THREADWATCHER_DIR" @@ -82,8 +83,10 @@ scan(){ #check for internet again, in case something has changed during the download process if ping -q -c 1 4channel.org > /dev/null then - echo "Thread $url not found ($dl_location) deleting from cached list of threads to watch" - notify-send "threadwatcher" "Thread downloading to $(echo "$dl_location" | sed "s|$HOME|~|") is complete now." + if [ "$AUTORM" = "true" ]; then + echo "Thread $url not found ($dl_location) deleting from cached list of threads to watch" + notify-send "threadwatcher" "Thread downloading to $(echo "$dl_location" | sed "s|$HOME|~|") is complete now." + fi else echo "Cannot connect to 4chan." exit 1