# $Id$ provide citrix storefront # needs fluxbox and idesk! require fluxbox idesk # 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] [store] [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 " store - storefront store uri" 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 store="${CLASS_ARGV[3]}" local user="${CLASS_ARGV[4]}" local domain="${CLASS_ARGV[5]}" local password="${CLASS_ARGV[6]}" local i [[ -z ${action} ]] && help_storefront_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 # and storefront uri [[ -z ${store} ]] && help_storefront_session && return 1 # create storefront session starter ${MCORE_LIBDIR}/storefront-session \ --add \ --name "${name}" \ --session "${session}" \ --store "${store}" \ --user "${user}" \ --domain "${domain}" \ --password "${password}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/storefront-session --del --name "${name}" else for i in $(NOCOLORS=1 ${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_storefront_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) x11runas "${MCORE_LIBDIR}/storefront-resolver --addstore --store '${store}'" ;; #del) #if [[ -n ${store} ]] #then #x11runas "${MCORE_LIBDIR}/storefront-resolver --delstore --store '${store}'" #else ## delete all items #for i in $(x11runas "NOCOLORS=1 ${MCORE_LIBDIR}/storefront-resolver --liststore") #do #x11runas "${MCORE_LIBDIR}/storefront-resolver --delstore --store '${i}'" #done #fi #;; #*) help_storefront_store && return 1 ;; #esac #} #get_storefront_store() #{ #x11runas "${MCORE_LIBDIR}/storefront-resolver --liststore" #} 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) [[ -z ${store} ]] && help_storefront_store && return 1 ${MCORE_LIBDIR}/storefront-store --add --store "${store}" ;; del) if [[ -n ${store} ]] then ${MCORE_LIBDIR}/storefront-store --del --store "${store}" else # delete all items ${MCORE_LIBDIR}/storefront-store --del fi ;; *) help_storefront_store && return 1 ;; esac } get_storefront_store() { ${MCORE_LIBDIR}/storefront-store --print }