Completed error function

This commit is contained in:
2020-05-02 13:15:15 +02:00
parent a49901eb5b
commit 283abc9d8f
2 changed files with 17 additions and 4 deletions

View File

@@ -56,6 +56,19 @@ success(){
message "${COLOR_GREEN}" "SUCCESS" "$1";
}
error(){
message "${COLOR_RED}" "ERROR" "$1 -> Leaving program."
if declare -f "destructor" > /dev/null
then
info "Calling destructor..."
destructor
else
warning "No destructor defined."
info "Can be that this script left some waste."
fi
exit 1;
}
HEADER(){
echo
echo "${COLOR_YELLOW}The"