diff --git a/bsf.sh b/bsf.sh index d660ab2..13ac63b 100644 --- a/bsf.sh +++ b/bsf.sh @@ -12,6 +12,10 @@ sayn () { printf %s "$*" ; } ## check if user is root root () { [[ "$EUID" -eq 0 ]] ; } +## check if last call had errors +## if yes print generic error message and exit +ok() { [[ "$?" -ne 0 ]] && echo "ERROR, aborting." && exit 1; } + ## colors # use ANSI escape codes normal () { printf '\033[0m' ; }