# $Id$ provide citrix ica # needs fluxbox! require fluxbox basic-video # citrix global config include @@SYSCONFDIR@@/mcore/citrix.conf help_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 mecho " If no [host] was given, all entries are deleted." } help_citrix_session() { 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." mecho " Available actions:" mecho " add - adds a new ica session" mecho " del - deletes ica session with name [name]" mecho " if no [name] given, all sessions will be deleted" mecho mecho " Available modes:" mecho " fullscreen - fullscreen session" mecho " seamless - seamless windows session" mecho " *x* - windowed session with given resolution" mecho " any resonable resolution is fine like:" mecho " 1024x768, 1280x1024, 1440x900 etc" 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" mecho " autostart - session autostart 0=off 1=on- optional" } set_citrix_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 serverlist="${CLASS_ARGV[7]}" local autostart="${CLASS_ARGV[8]}" local i local opts [[ -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 if [[ -n ${serverlist} ]] then opts="--serverlist ${serverlist}" fi # create citrix session file ${MCORE_LIBDIR}/citrix-session \ --add \ --name "${name}" \ --session "${session}" \ --mode "${mode}" \ --user "${user}" \ --domain "${domain}" \ --password "${password}" \ --autostart "${autostart}" \ ${opts} ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/citrix-session --del --name "${name}" else for i in $(NOCOLORS=1 ${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_citrix_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_citrix_serverlist() { local action="${CLASS_ARGV[0]}" local server="${CLASS_ARGV[1]}" local i [[ -z ${action} ]] && help_citrix_serverlist && return 1 case "${action}" in add) ${MCORE_LIBDIR}/citrix-serverlist --add --server "${server}" ;; del) if [[ -n ${server} ]] then ${MCORE_LIBDIR}/citrix-serverlist --del --server "${server}" else # delete all items for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/citrix-serverlist --print) do ${MCORE_LIBDIR}/citrix-serverlist --del --server "${i}" done fi ;; auto) ${MCORE_LIBDIR}/citrix-serverlist --auto ;; *) help_citrix_serverlist && return 1 ;; esac } get_citrix_serverlist() { local action="${CLASS_ARGV[0]}" [[ -z ${action} ]] && help_citrix_serverlist && return 1 case "${action}" in print) ${MCORE_LIBDIR}/citrix-serverlist --print ;; query) ${MCORE_LIBDIR}/citrix-serverlist --query ;; *) help_citrix_session && return 1 ;; esac }