Browse Source

Fix : binary operator expected and don't use a not not operator

pull/276/head
Poil 10 years ago
parent
commit
8d46a49a01
  1. 22
      functions/fn_messages

22
functions/fn_messages

@ -8,7 +8,7 @@
# Date and servicename for log files. # Date and servicename for log files.
fn_scriptlog(){ fn_scriptlog(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}" echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
@ -17,7 +17,7 @@ fn_scriptlog(){
# [ FAIL ] # [ FAIL ]
fn_printfail(){ fn_printfail(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
else else
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@" echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@"
@ -25,7 +25,7 @@ fn_printfail(){
} }
fn_printfailnl(){ fn_printfailnl(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
else else
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@" echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@"
@ -34,7 +34,7 @@ fn_printfailnl(){
# [ OK ] # [ OK ]
fn_printok(){ fn_printok(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" echo -en "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@"
else else
echo -en "\r\033[K[\e[0;32m OK \e[0m] $@" echo -en "\r\033[K[\e[0;32m OK \e[0m] $@"
@ -42,7 +42,7 @@ fn_printok(){
} }
fn_printoknl(){ fn_printoknl(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" echo -e "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@"
else else
echo -e "\r\033[K[\e[0;32m OK \e[0m] $@" echo -e "\r\033[K[\e[0;32m OK \e[0m] $@"
@ -51,7 +51,7 @@ fn_printoknl(){
# [ INFO ] # [ INFO ]
fn_printinfo(){ fn_printinfo(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
else else
echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@" echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@"
@ -59,7 +59,7 @@ fn_printinfo(){
} }
fn_printinfonl(){ fn_printinfonl(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
else else
echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@" echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@"
@ -68,7 +68,7 @@ fn_printinfonl(){
# [ WARN ] # [ WARN ]
fn_printwarn(){ fn_printwarn(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
else else
echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@" echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@"
@ -76,7 +76,7 @@ fn_printwarn(){
} }
fn_printwarnnl(){ fn_printwarnnl(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
else else
echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@" echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@"
@ -85,7 +85,7 @@ fn_printwarnnl(){
# [ .... ] # [ .... ]
fn_printdots(){ fn_printdots(){
if [ ! -z ${modulename} ]; then if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@" echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@"
else else
echo -en "\r\033[K[ .... ] $@" echo -en "\r\033[K[ .... ] $@"
@ -126,4 +126,4 @@ fn_printerror(){
fn_printerrornl(){ fn_printerrornl(){
echo -e "\e[0;31mError!\e[0m $@" echo -e "\e[0;31mError!\e[0m $@"
} }

Loading…
Cancel
Save