From 19b6c0d77e6555e167339cf13d8877cf4284ee97 Mon Sep 17 00:00:00 2001 From: Botspot Date: Thu, 9 Sep 2021 00:25:04 -0500 Subject: [PATCH] api: wget(): suppress aria2c output if -q flag passed --- api | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api b/api index 4134ce9..9e1ba15 100755 --- a/api +++ b/api @@ -548,7 +548,13 @@ wget() { #this function intercepts all wget commands being used in app scripts. if [ -z "$file" ];then file="$(pwd)/$(basename "$url")" fi - aria2c -c -x 16 -s 16 -m 10 --retry-wait 30 "$url" --dir '/' -o "${file:1}" --allow-overwrite --summary-interval=1 + + #suppress output if -q flag passed + if echo "$@" | grep -q '\-q' ;then + aria2c -c -x 16 -s 16 -m 10 --retry-wait 30 "$url" --dir '/' -o "${file:1}" --allow-overwrite --summary-interval=1 >/dev/null + else + aria2c -c -x 16 -s 16 -m 10 --retry-wait 30 "$url" --dir '/' -o "${file:1}" --allow-overwrite --summary-interval=1 + fi fi }