From 1272a80ae0accbac314624497290de714f068041 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Wed, 16 Jun 2021 18:36:39 +0200 Subject: [PATCH] no ping printout --- threadwatcher | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadwatcher b/threadwatcher index 7c0e509..7eba422 100755 --- a/threadwatcher +++ b/threadwatcher @@ -45,7 +45,7 @@ scan(){ done #Create lock file to stop override of URLFILE while scanning touch /tmp/threadwatcher.lock - ping -q -c 1 4channel.org || { 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 echo "scanning threads..." else @@ -65,7 +65,7 @@ scan(){ echo "$url ($thread_title) $(echo "$dl_location" | sed "s|$HOME|~|")" if [ -z "$(/dev/null + 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." @@ -136,7 +136,7 @@ dl_location="$(makepathabsolute "$2")" fi ## Move already downloaded files to new location - ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 4channel.org || { echo "No internet connection detected."; exit ;} + ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 4channel.org > /dev/null || { echo "No internet connection detected."; exit ;} mkdir -p "$new_location" url="$1" json_url="$(echo "$url" | sed -E 's/boards\.(4chan|4channel)/a.4cdn/; s/$/.json/')"