--- mcore-src/trunk/mcore-tools/src/mcored.in 2014/01/13 14:25:18 2258 +++ mcore-src/trunk/mcore-tools/src/mcored.in 2014/01/20 14:04:52 2303 @@ -17,7 +17,7 @@ include ${MCORE_LIBDIR}/include/hwdetection.global.class # load client classes plugins -load_client_classes +load_classes client # config settings include @@SYSCONFDIR@@/mcore/mcore.conf @@ -57,6 +57,12 @@ WEBCRLF="false" QUIET="false" +# argvs are global variables - this fixes issues with whitespaces +# global argvs, the whole command line +export GLOBAL_ARGV +# class specific argvs which are given to the class as parameters +export CLASS_ARGV + run=run valid_session=no @@ -66,18 +72,19 @@ while [[ ${run} = run ]] do read line + eval "GLOBAL_ARGV=( ${line} )" - case ${line} in + case ${GLOBAL_ARGV[0]} in quit) run=quit ;; # only react on the globals -> import|get|set|auth - import*) run_class ${line} ;; - get*) run_class ${line} ;; - set*) run_class ${line} ;; - auth*) validate_auth ${line/auth /} ;; + import) run_class ;; + get) run_class ;; + set) run_class ;; + auth) validate_auth ${GLOBAL_ARGV[*]:1} ;; provide) valid_session && print_provide ;; require) valid_session && verify_requirements ;; - reload) valid_session && mecho "reloading client classes ..." && load_client_classes ;; + reload) valid_session && mecho "reloading client classes ..." && load_classes client ;; restart) valid_session && restart_service ;; stop) valid_session && stop_service ;; nocolors) export NOCOLORS="true" ;; @@ -86,7 +93,7 @@ quiet) export QUIET="true" ;; # version does not need auth version) print_version ;; - help*) + help) if valid_session then if [[ ${line} = help ]] @@ -107,4 +114,8 @@ #echo "$line" >> /root/lala.log ;; esac + + # unset argvs to be safe + unset GLOBAL_ARGS + unset CLASS_ARGS done