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. # ------------------------------------------------------------------------------