--- mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2011/02/04 20:13:23 1264 +++ mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2011/02/06 23:48:20 1308 @@ -26,7 +26,7 @@ local cmd local argv - if validate_session + if valid_session then class="${caller%.*}" cmd="${caller#*.}" @@ -63,6 +63,8 @@ mecho "\tset - sets value for a setting" mecho "\tauth - authenticate to the daemon" mecho "\tprovide - shows provides of a system" + mecho "\trequire - verify plugin requirements" + mecho "\nocolors - disable colors, useful for the webclient" mecho "\thelp - shows help" mecho "\tquit - quits the connection to the server" mecho @@ -88,6 +90,8 @@ addconfig() { + local opts + if [[ -z ${CONFIG} ]] then echo "You must define \$CONFIG varibale first!" @@ -98,7 +102,14 @@ then install -d $(dirname ${CONFIG}) fi - echo "$@" >> ${CONFIG} + + # check for opts + case $1 in + -n) shift; opts=" -n" ;; + -e) shift; opts=" -e" ;; + esac + + echo ${opts} "$@" >> ${CONFIG} } clearconfig() @@ -222,6 +233,7 @@ local COLCYAN="\033[1;36m" local COLDEFAULT="\033[0m" local opts + local webcrlf if [[ ${NOCOLORS} = true ]] then @@ -229,12 +241,14 @@ COLDEFAULT="" fi + [[ ${WEBCRLF} = true ]] && webcrlf="
" + # respect -n case $1 in -n) shift; opts="n" ;; esac - echo -e${opts} "${COLCYAN}$@${COLDEFAULT}" + echo -e${opts} "${COLCYAN}$@${COLDEFAULT}${webcrlf}" } eecho() @@ -242,6 +256,7 @@ local COLRED="\033[1;31m" local COLDEFAULT="\033[0m" local opts + local webcrlf if [[ ${NOCOLORS} = true ]] then @@ -249,12 +264,14 @@ COLDEFAULT="" fi + [[ ${WEBCRLF} = true ]] && webcrlf="
" + # respect -n case $1 in -n) shift; opts="n" ;; esac - echo -e${opts} "${COLRED}$@${COLDEFAULT}" + echo -e${opts} "${COLRED}$@${COLDEFAULT}${webcrlf}" } path_not_empty()