#!/bin/bash function isSuccessful() { echo -e "${GREEN}SUCCESS:${NC} $1" } function isError() { echo -e "${RED}ERROR:${NC} $1" } function isFatalError() { echo -e "${RED}ERROR:${NC} $1" } function isFatalErrorExit() { echo -e "${RED}ERROR:${NC} $1" echo "" exit 1 } function isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1" } function isQuestion() { echo -e -n "${BLUE}QUESTION:${NC} $1 " } function isOptionMenu() { echo -e -n "${PINK}OPTION:${NC} $1" } function isOption() { echo -e "${PINK}OPTION:${NC} $1" } function isHeader() { local title="$1" local width=52 local inner=$((width - 6)) local title_len=${#title} local total_pad=$((inner - title_len)) if (( total_pad < 0 )); then total_pad=0; fi local left_pad=$((total_pad / 2)) local right_pad=$((total_pad - left_pad)) local bar bar=$(printf '%*s' "$width" '' | tr ' ' '#') echo "" echo "$bar" printf '###%*s%s%*s###\n' "$left_pad" '' "$title" "$right_pad" '' echo "$bar" echo "" }