# $Id$ provide rdesktop rdp # needs fluxbox! require fluxbox basic-video help_rdesktop_session() { mecho "get rdesktop.session" mecho " Shows all configured RDP sessions" mecho " print - prints all local configured sessions" mecho mecho "set rdesktop.session [action] [name] [server] [mode] [user] [domain] [password] [shell] [autostart]" mecho " Adds or deletes a RDP session." mecho " Available actions:" mecho " add - adds a new rdp session" mecho " del - deletes a rdp session named [name]" mecho " if no [name] was given, all sessions will be deleted" mecho mecho " Available modes:" mecho " fullscreen - fullscreen session" mecho " *x* - windowed session with given resolution" mecho " any resonable resolution is fine like:" mecho " 1024x768, 1280x1024, 1440x900 etc" mecho mecho " server - IP oder hostname of the RDP server" mecho " user - user inside the session - optional" mecho " domain - logon domain of the user - optional" mecho " password - password of the user - optional" mecho " shell - shell or seamless application to start remotly - optional" mecho " autostart - session autostart 0=off 1=on- optional" } set_rdesktop_session() { local action="${CLASS_ARGV[0]}" local name="${CLASS_ARGV[1]}" local server="${CLASS_ARGV[2]}" local mode="${CLASS_ARGV[3]}" local user="${CLASS_ARGV[4]}" local domain="${CLASS_ARGV[5]}" local password="${CLASS_ARGV[6]}" local shell="${CLASS_ARGV[7]}" local autostart="${CLASS_ARGV[8]}" local i local opts [[ -z ${action} ]] && help_rdesktop_session && return 1 case "${action}" in add) # requires name [[ -z ${name} ]] && help_rdesktop_session && return 1 # action 'add' need mode too [[ -z ${mode} ]] && help_rdesktop_session && return 1 # and server [[ -z ${server} ]] && help_rdesktop_session && return 1 # other sanity checks case "${mode}" in fullscreen) ;; *x*) ;; *) help_rdesktop_session && return 1 ;; esac # create citrix session file ${MCORE_LIBDIR}/rdesktop-session \ --add \ --name "${name}" \ --server "${server}" \ --mode "${mode}" \ --user "${user}" \ --domain "${domain}" \ --password "${password}" \ --shell "${shell}" \ --autostart "${autostart}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/rdesktop-session --del --name "${name}" else for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/rdesktop-session --print) do # basename name="${i%.*}" ${MCORE_LIBDIR}/rdesktop-session --del --name "${name}" done fi ;; *) help_rdesktop_session && return 1 ;; esac } get_rdesktop_session() { local action="${CLASS_ARGV[0]}" [[ -z ${action} ]] && help_rdesktop_session && return 1 case "${action}" in print) ${MCORE_LIBDIR}/rdesktop-session --print ;; *) help_rdesktop_session && return 1 ;; esac }