--- mcore-src/trunk/mcore-tools/src/include/daemon.global.class.in 2014/01/20 14:02:27 2302 +++ mcore-src/trunk/mcore-tools/src/include/daemon.global.class.in 2015/09/17 07:22:58 2553 @@ -1,14 +1,20 @@ # $Id$ # loads client classes from $MCORE_LIBDIR -load_client_classes() +load_classes() { - local i + local class + local classtype + + case $1 in + client|control) classtype="$1" ;; + *) die "Unknown classes type '$1'" ;; + esac # client specific - for i in $(find ${MCORE_LIBDIR}/include -type f -name \*.client.class) + for class in $(find ${MCORE_LIBDIR}/include -type f -name \*.${classtype}.class) do - include ${i} || eecho "error loading ${i}" + include ${class} || eecho "error loading ${class}" done } @@ -90,6 +96,21 @@ fi } +run_push_config() +{ + local config + + for config in $(print_push_config) + do + if [[ -n $(typeset -f push_config_${config}) ]] + then + push_config_"${config}" + else + decho "no function 'push_config_${config}' for '${config}' found." + fi + done +} + help_topics() { local i @@ -101,6 +122,7 @@ mecho "\tget - shows current value for a settings" mecho "\tset - sets value for a setting" mecho "\tauth - authenticate to the daemon" + mecho "\tcertauth - authenticate to the daemon via fingerprint" mecho "\tprovide - shows provides of a system" mecho "\trequire - verify plugin requirements" mecho "\treload - reloads all client classes plugins" @@ -215,6 +237,52 @@ # do not escape, or CRLFS get printed to screen too rvecho ${sorted} } + +is_provided() +{ + local feature="$1" + local i + local retval + + retval=1 + for i in $(print_provide) + do + if [[ ${i} = ${feature} ]] + then + retval=0 + break + fi + done + + return "${retval}" +} + +push_config() +{ + local push_configs="$@" + local i + + for i in ${push_configs} + do + # check for duplicate provides + if no_duplicate "${PUSH_CONFIG}" "${i}" + then + export PUSH_CONFIG="${PUSH_CONFIG} ${i}" + else + decho "duplicate push_config '${i}' detected!" + fi + done +} + +print_push_config() +{ + local sorted + + # sort them alpabetically + push_config=$(for i in ${PUSH_CONFIG}; do echo "${i}"; done | sort) + # do not escape, or CRLFS get printed to screen too + rvecho ${sorted} +} help_daemon_mroot() {