# $Id$ provide citrix storefront # needs fluxbox! require fluxbox basic-video # citrix global config include @@SYSCONFDIR@@/mcore/citrix.conf help_storefront_store() { mecho "get storefront.store" mecho " Shows all stores added on the storelist." mecho mecho "set storefront.store [action] [store]" mecho " Adds or deletes a store from the storefront storelist." mecho " [actions]:" mecho " add - adds a store" mecho " del - deletes a store" mecho mecho " store - FQDN to the store" mecho mecho " If no [store] was given, all entries are deleted." } help_storefront_session() { mecho "get storefront.session" mecho " Shows all configured storefront sessions" mecho " print - prints all local configured sessions" mecho " query - get sessionlist of the farm from given [server]" mecho mecho "set storefront.session [action] [name] [session] [user] [domain] [password]" mecho " Adds or delets a storefront session." mecho " Available actions:" mecho " add - adds a new storefront session" mecho " del - deletes storefront session with name [name]" mecho " if no [name] given, all sessions will be deleted" mecho mecho " session - name of the Citrix session" mecho " user - user inside the session - optional" mecho " domain - logon domain of the user - optional" mecho " password - password of the user - optional" } set_storefront_session() { local action="${CLASS_ARGV[0]}" local name="${CLASS_ARGV[1]}" local session="${CLASS_ARGV[2]}" local mode="${CLASS_ARGV[3]}" local user="${CLASS_ARGV[4]}" local domain="${CLASS_ARGV[5]}" local password="${CLASS_ARGV[6]}" local i [[ -z ${action} ]] && help_citrix_session && return 1 case "${action}" in add) # requires name [[ -z ${name} ]] && help_citrix_session && return 1 # action 'add' need mode too [[ -z ${mode} ]] && help_citrix_session && return 1 # and session [[ -z ${session} ]] && help_citrix_session && return 1 # other sanity checks case "${mode}" in fullscreen) ;; seamless) ;; *x*) ;; *) help_citrix_session && return 1 ;; esac # create citrix session file ${MCORE_LIBDIR}/citrix-session \ --add \ --name "${name}" \ --session "${session}" \ --mode "${mode}" \ --user "${user}" \ --domain "${domain}" \ --password "${password}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/citrix-session --del --name "${name}" else for i in $(NOCOLORS=true ${MCORE_LIBDIR}/citrix-session --print) do # basename name="${i%.*}" ${MCORE_LIBDIR}/citrix-session --del --name "${name}" done fi ;; *) help_citrix_session && return 1 ;; esac } get_storefront_session() { local action="${CLASS_ARGV[0]}" [[ -z ${action} ]] && help_citrix_serverlist && return 1 case "${action}" in print) ${MCORE_LIBDIR}/citrix-session --print ;; query) ${MCORE_LIBDIR}/citrix-session --query ;; *) help_citrix_session && return 1 ;; esac } set_storefront_store() { local action="${CLASS_ARGV[0]}" local store="${CLASS_ARGV[1]}" local i [[ -z ${action} ]] && help_storefront_store && return 1 case "${action}" in add) ${MCORE_LIBDIR}/storefront-resolver addstore "${store}" ;; del) if [[ -n ${store} ]] then ${MCORE_LIBDIR}/storefront-resolver delstore "${store}" else # delete all items for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) do ${MCORE_LIBDIR}/storefront-resolver delstore "${i}" done fi ;; *) help_citrix_serverlist && return 1 ;; esac } get_storefront_store() { ${MCORE_LIBDIR}/storefront-resolver liststore;; }