From e4e44244c872e0e2ae5bccf20373fb38f3ca5036 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 8 May 2025 09:21:19 +0200 Subject: [PATCH] Update core.func --- misc/core.func | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/misc/core.func b/misc/core.func index ef4e35a..7215d76 100644 --- a/misc/core.func +++ b/misc/core.func @@ -87,6 +87,26 @@ default_vars() { i=$RETRY_NUM } +# ------------------------------------------------------------------------------ +# Sets default verbose mode for script execution. +# ------------------------------------------------------------------------------ +set_std_mode() { + if [ "$VERB" = "yes" ]; then + STD="" + else + STD="silent" + fi +} + +# Silent execution function +silent() { + if [ "$VERB" = "no" ]; then + "$@" >/dev/null 2>&1 || return 1 + else + "$@" || return 1 + fi +} + # ------------------------------------------------------------------------------ # Performs a curl request with retry logic and inline feedback. # ------------------------------------------------------------------------------