mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-24 17:58:58 +02:00
refactoring: split helper functions into smaller scripts (#2420)
This commit is contained in:
parent
2927cc47c7
commit
b61dfe1e24
41 changed files with 389 additions and 396 deletions
24
target/scripts/helpers/log.sh
Executable file
24
target/scripts/helpers/log.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#! /bin/bash
|
||||
|
||||
function _notify
|
||||
{
|
||||
{ [[ -z ${1:-} ]] || [[ -z ${2:-} ]] ; } && return 0
|
||||
|
||||
local RESET LGREEN LYELLOW LRED RED LBLUE LGREY LMAGENTA
|
||||
|
||||
RESET='\e[0m' ; LGREEN='\e[92m' ; LYELLOW='\e[93m'
|
||||
LRED='\e[31m' ; RED='\e[91m' ; LBLUE='\e[34m'
|
||||
LGREY='\e[37m' ; LMAGENTA='\e[95m'
|
||||
|
||||
case "${1}" in
|
||||
'tasklog' ) echo "-e${3:-}" "[ ${LGREEN}TASKLOG${RESET} ] ${2}" ;;
|
||||
'warn' ) echo "-e${3:-}" "[ ${LYELLOW}WARNING${RESET} ] ${2}" ;;
|
||||
'err' ) echo "-e${3:-}" "[ ${LRED}ERROR${RESET} ] ${2}" ;;
|
||||
'fatal' ) echo "-e${3:-}" "[ ${RED}FATAL${RESET} ] ${2}" ;;
|
||||
'inf' ) [[ ${DMS_DEBUG} -eq 1 ]] && echo "-e${3:-}" "[[ ${LBLUE}INF${RESET} ]] ${2}" ;;
|
||||
'task' ) [[ ${DMS_DEBUG} -eq 1 ]] && echo "-e${3:-}" "[[ ${LGREY}TASKS${RESET} ]] ${2}" ;;
|
||||
* ) echo "-e${3:-}" "[ ${LMAGENTA}UNKNOWN${RESET} ] ${2}" ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue