Linux_frogg-profile.d/func/message.sh

43 lines
782 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

msg_status_text()
{
local type="$1" msg="$2"
case "$type" in
ok|success)
echo -e "${COLOR_GREEN}${msg}${NONE}"
;;
warn|warning)
echo -e "${COLOR_YELLOW}${msg}${NONE}"
;;
error|err)
echo -e "${COLOR_LIGHT_RED}${msg}${NONE}"
;;
info|inf)
echo -e "${COLOR_LIGHT_BLUE} ${msg}${NONE}"
;;
*)
echo -e "${msg}"
;;
esac
}
msg_success() {
msg_status_text success "$1"
}
# Fonction Erreur (Cross)
msg_error() {
msg_status_text error "$1"
}
# Fonction Warning (Exclamation)
msg_warning() {
msg_status_text warning "$1"
}
# Fonction Info (i)
msg_info() {
msg_status_text info "$1"
}