37 lines
920 B
Bash
Executable File
37 lines
920 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
function_log () {
|
|
|
|
if [ "$1" ]; then
|
|
|
|
if [ "${MODE_QUIET}" == false ]; then
|
|
|
|
echo -e $1
|
|
|
|
elif [ "${MODE_QUIET}" == true ] && [ "$#" -ge 2 ] && [ "$2" == true ]; then
|
|
|
|
echo -e $1
|
|
|
|
fi
|
|
|
|
echo -e "`date "+%I:%M:%S"` $(hostname) $SID: $1" | sed -r 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g' | sed -e 's/^[ \t]*//' >>$FILE_LOG
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function_strtolower () {
|
|
|
|
[[ "$1" == "" ]] && { function_log "error: ${LIGHT_RED}failed to locate any argument in request. File: include/helper.inc, Line: 17${NC}"; exit 1; }
|
|
|
|
echo "$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
|
|
|
}
|
|
|
|
function_strtoupper () {
|
|
|
|
[[ "$1" == "" ]] && { function_log "error: ${LIGHT_RED}failed to locate any argument in request. File: include/helper.inc, Line: 25${NC}"; exit 1; }
|
|
|
|
echo "$(echo "$1" | tr '[:lower:]' '[:upper:]')"
|
|
|
|
} |