--- mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2011/03/10 18:08:47 1639 +++ mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2012/08/13 09:40:07 2006 @@ -1,5 +1,37 @@ # $Id$ +# loads client classes from $MCLIBDIR +load_client_classes() +{ + # client specific + for i in ${MCLIBDIR}/include/*.client.class + do + source ${i} || eecho "error loading ${i}" + done +} + +# restarts the whole service via remote cmd +restart_service() +{ + local pid + for pid in $(pidof sslsvd) + do + kill -SIGHUP ${pid} + done +} + +# stops the whole service via remote cmd +stop_service() +{ + local pid + for pid in $(pidof sslsvd) + do + kill -15 ${pid} + sleep 1 + kill -9 ${pid} + done +} + # # import_resource $table $serial $resource $value # import_resource() # { @@ -64,7 +96,11 @@ mecho "\tauth - authenticate to the daemon" mecho "\tprovide - shows provides of a system" mecho "\trequire - verify plugin requirements" + mecho "\treload - reloads all client classes plugins" + mecho "\trestart - restarts the daemon" + mecho "\tstop - stops the daemon" mecho "\tnocolors - disable colors, useful for the webclient" + mecho "\tcolors - enable colors" mecho "\tquiet - do not print any unecessary messages" mecho "\thelp - shows help" mecho "\tquit - quits the connection to the server" @@ -86,7 +122,7 @@ # on newer xorg-servers root is not allowed to run progs in a user session x11runas() { - if pidof X + if [[ -n $(pidof X) ]] then su - "${MCORE_UNPRIV_USER}" -c "DISPLAY=${MCORE_XORG_DISPLAY} $@" fi @@ -229,7 +265,7 @@ # sort them alpabetically sorted=$(for i in ${PROVIDE}; do echo "${i}"; done | sort) # do not escape, or CRLFS get printed to screen too - rvecho ${sorted} + rvecho ${sorted} } # message only echo | disabled in quiet mode