# $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 [action] [user] [domain] [password]" 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 user="${CLASS_ARGV[3]}" local domain="${CLASS_ARGV[4]}" local password="${CLASS_ARGV[5]}" local i [[ -z ${action} ]] && help_citrix_session && return 1 case "${action}" in add) # requires name [[ -z ${name} ]] && help_storefront_session && return 1 # and session [[ -z ${session} ]] && help_storefront_session && return 1 # create storefront session starter ${MCORE_LIBDIR}/storefront-session \ --add \ --name "${name}" \ --session "${session}" \ --user "${user}" \ --domain "${domain}" \ --password "${password}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/storefront-session --del --name "${name}" else for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-session --print) do # basename name="${i%.*}" ${MCORE_LIBDIR}/storefront-session --del --name "${name}" done fi ;; *) help_storefront_session && return 1 ;; esac } get_storefront_session() { local action="${CLASS_ARGV[0]}" local user="${CLASS_ARGV[1]}" local domain="${CLASS_ARGV[2]}" local password="${CLASS_ARGV[3]}" [[ -z ${action} ]] && help_storefront_session && return 1 case "${action}" in print) ${MCORE_LIBDIR}/storefront-session --print ;; query) if [[ -n ${user} ]] then ${MCORE_LIBDIR}/storefront-session --query --user "${user}" --domain "${domain}" --password "${password}" else ${MCORE_LIBDIR}/storefront-session --query fi ;; *) 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) su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver addstore '${store}'" ;; del) if [[ -n ${store} ]] then su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${store}'" else # delete all items for i in $(su - "${MCORE_UNPRIV_USER}" -c NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) do su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'" done fi ;; *) help_citrix_serverlist && return 1 ;; esac } get_storefront_store() { su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver liststore" }