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

Loading…
Cancel
Save