Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/src/modules/rdesktop/rdesktop.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2726 - (show annotations) (download)
Thu Jan 28 14:20:01 2016 UTC (8 years, 3 months ago) by niro
File size: 2961 byte(s)
-added rdesktop module
1 # $Id$
2
3 provide rdesktop rdp
4
5 # needs fluxbox!
6 require fluxbox basic-video
7
8 help_rdesktop_session()
9 {
10 mecho "get rdesktop.session"
11 mecho " Shows all configured RDP sessions"
12 mecho " print - prints all local configured sessions"
13 mecho
14 mecho "set rdesktop.session [action] [name] [server] [mode] [user] [domain] [password] [shell] [autostart]"
15 mecho " Adds or deletes a RDP session."
16 mecho " Available actions:"
17 mecho " add - adds a new rdp session"
18 mecho " del - deletes a rdp session named [name]"
19 mecho " if no [name] was given, all sessions will be deleted"
20 mecho
21 mecho " Available modes:"
22 mecho " fullscreen - fullscreen session"
23 mecho " *x* - windowed session with given resolution"
24 mecho " any resonable resolution is fine like:"
25 mecho " 1024x768, 1280x1024, 1440x900 etc"
26 mecho
27 mecho " server - IP oder hostname of the RDP server"
28 mecho " user - user inside the session - optional"
29 mecho " domain - logon domain of the user - optional"
30 mecho " password - password of the user - optional"
31 mecho " shell - shell or seamless application to start remotly - optional"
32 mecho " autostart - session autostart 0=off 1=on- optional"
33 }
34
35 set_rdesktop_session()
36 {
37 local action="${CLASS_ARGV[0]}"
38 local name="${CLASS_ARGV[1]}"
39 local server="${CLASS_ARGV[2]}"
40 local mode="${CLASS_ARGV[3]}"
41 local user="${CLASS_ARGV[4]}"
42 local domain="${CLASS_ARGV[5]}"
43 local password="${CLASS_ARGV[6]}"
44 local shell="${CLASS_ARGV[7]}"
45 local autostart="${CLASS_ARGV[8]}"
46 local i
47 local opts
48
49 [[ -z ${action} ]] && help_rdesktop_session && return 1
50
51 case "${action}" in
52 add)
53 # requires name
54 [[ -z ${name} ]] && help_rdesktop_session && return 1
55 # action 'add' need mode too
56 [[ -z ${mode} ]] && help_rdesktop_session && return 1
57 # and server
58 [[ -z ${server} ]] && help_rdesktop_session && return 1
59
60 # other sanity checks
61 case "${mode}" in
62 fullscreen) ;;
63 *x*) ;;
64 *) help_rdesktop_session && return 1 ;;
65 esac
66
67 # create citrix session file
68 ${MCORE_LIBDIR}/rdesktop-session \
69 --add \
70 --name "${name}" \
71 --server "${server}" \
72 --mode "${mode}" \
73 --user "${user}" \
74 --domain "${domain}" \
75 --password "${password}" \
76 --shell "${shell}" \
77 --autostart "${autostart}"
78 ;;
79
80 del)
81 if [[ -n ${name} ]]
82 then
83 ${MCORE_LIBDIR}/rdesktop-session --del --name "${name}"
84 else
85 for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/rdesktop-session --print)
86 do
87 # basename
88 name="${i%.*}"
89 ${MCORE_LIBDIR}/rdesktop-session --del --name "${name}"
90 done
91 fi
92 ;;
93
94 *) help_rdesktop_session && return 1 ;;
95 esac
96 }
97
98 get_rdesktop_session()
99 {
100 local action="${CLASS_ARGV[0]}"
101
102 [[ -z ${action} ]] && help_rdesktop_session && return 1
103
104 case "${action}" in
105 print) ${MCORE_LIBDIR}/rdesktop-session --print ;;
106 *) help_rdesktop_session && return 1 ;;
107 esac
108 }