--- mcore-src/trunk/mcore-tools/src/modules/citrix/citrix.client.class.in 2014/01/10 14:17:06 2179 +++ mcore-src/trunk/mcore-tools/src/modules/citrix/citrix.client.class.in 2014/01/13 14:39:52 2259 @@ -5,16 +5,23 @@ # needs fluxbox! require fluxbox basic-video +# citrix global config +include @@SYSCONFDIR@@/mcore/citrix.conf + help_citrix_serverlist() { - mecho "get citrix.serverlist" + mecho "get citrix.serverlist [action]" mecho " Shows all hosts added on the serverlist." + mecho " [actions]:" + mecho " print - prints local configured serverlist" + mecho " query - get serverlist of the farm from given [server]" mecho mecho "set citrix.serverlist [action] [host]" mecho " Adds or deletes a server from the ica serverlist." mecho " [actions]:" mecho " add - adds a server" mecho " del - deletes a server" + mecho " auto - queries given [server] for the serverlist and adds all of them" mecho mecho " host - dns hostname or ip of the server" mecho @@ -25,6 +32,8 @@ { mecho "get citrix.session" mecho " Shows all configured ICA sessions" + mecho " print - prints all local configured sessions" + mecho " query - get sessionlist of the farm from given [server]" mecho mecho "set citrix.session [action] [name] [session] [mode] [user] [domain] [password]" mecho " Adds or delets a ICA session." @@ -166,7 +175,38 @@ get_citrix_session() { - list_files_in_directory ${MROOT}/${MCORE_CONFIG_PATH}/citrix/ica + local action="$1" + local server="$2" + local sessionlist + local sessioncount + local i + local exclude + + [[ -z ${action} ]] && help_citrix_serverlist && return 1 + + case "${action}" in + print) list_files_in_directory ${MROOT}/${MCORE_CONFIG_PATH}/citrix/ica ;; + query) + [[ -n ${PNABROWSE_EXECUTABLE} ]] || eecho "\$PNABROWSE_EXECUTABLE not defined" + [[ -n ${PNABROWSE_CITRIX_BROWSER} ]] || eecho "\$PNABROWSE_CITRIX_BROWSER not defined" + if [ -x ${MROOT}/opt/ica-client/util/pnabrowse ] + then + if [[ -n ${PNABROWSE_SESSION_EXCLUDE} ]] + then + exclude="| grep -v '${PNABROWSE_SESSION_EXCLUDE}'" + fi + sessionlist=( $(${MROOT}/${PNABROWSE_EXECUTABLE} -A "${PNABROWSE_CITRIX_BROWSER}" ${exclude}) ) + sessioncount="${#sessionlist[*]}" + for (( i=0; i