Annotation of /mcore-src/trunk/mcore-tools/src/modules/citrix/storefront.client.class.in
Parent Directory | Revision Log
Revision 2354 -
(hide annotations)
(download)
Mon Aug 24 12:27:10 2015 UTC (8 years, 9 months ago) by niro
File size: 3696 byte(s)
Mon Aug 24 12:27:10 2015 UTC (8 years, 9 months ago) by niro
File size: 3696 byte(s)
-added storefront-session script and storefront.client.class
1 | niro | 2354 | # $Id$ |
2 | |||
3 | provide citrix storefront | ||
4 | |||
5 | # needs fluxbox! | ||
6 | require fluxbox basic-video | ||
7 | |||
8 | # citrix global config | ||
9 | include @@SYSCONFDIR@@/mcore/citrix.conf | ||
10 | |||
11 | help_storefront_store() | ||
12 | { | ||
13 | mecho "get storefront.store" | ||
14 | mecho " Shows all stores added on the storelist." | ||
15 | mecho | ||
16 | mecho "set storefront.store [action] [store]" | ||
17 | mecho " Adds or deletes a store from the storefront storelist." | ||
18 | mecho " [actions]:" | ||
19 | mecho " add - adds a store" | ||
20 | mecho " del - deletes a store" | ||
21 | mecho | ||
22 | mecho " store - FQDN to the store" | ||
23 | mecho | ||
24 | mecho " If no [store] was given, all entries are deleted." | ||
25 | } | ||
26 | |||
27 | help_storefront_session() | ||
28 | { | ||
29 | mecho "get storefront.session" | ||
30 | mecho " Shows all configured storefront sessions" | ||
31 | mecho " print - prints all local configured sessions" | ||
32 | mecho " query - get sessionlist of the farm from given [server]" | ||
33 | mecho | ||
34 | mecho "set storefront.session [action] [name] [session] [user] [domain] [password]" | ||
35 | mecho " Adds or delets a storefront session." | ||
36 | mecho " Available actions:" | ||
37 | mecho " add - adds a new storefront session" | ||
38 | mecho " del - deletes storefront session with name [name]" | ||
39 | mecho " if no [name] given, all sessions will be deleted" | ||
40 | mecho | ||
41 | mecho " session - name of the Citrix session" | ||
42 | mecho " user - user inside the session - optional" | ||
43 | mecho " domain - logon domain of the user - optional" | ||
44 | mecho " password - password of the user - optional" | ||
45 | } | ||
46 | |||
47 | set_storefront_session() | ||
48 | { | ||
49 | local action="${CLASS_ARGV[0]}" | ||
50 | local name="${CLASS_ARGV[1]}" | ||
51 | local session="${CLASS_ARGV[2]}" | ||
52 | local mode="${CLASS_ARGV[3]}" | ||
53 | local user="${CLASS_ARGV[4]}" | ||
54 | local domain="${CLASS_ARGV[5]}" | ||
55 | local password="${CLASS_ARGV[6]}" | ||
56 | local i | ||
57 | |||
58 | [[ -z ${action} ]] && help_citrix_session && return 1 | ||
59 | |||
60 | case "${action}" in | ||
61 | add) | ||
62 | # requires name | ||
63 | [[ -z ${name} ]] && help_citrix_session && return 1 | ||
64 | # action 'add' need mode too | ||
65 | [[ -z ${mode} ]] && help_citrix_session && return 1 | ||
66 | # and session | ||
67 | [[ -z ${session} ]] && help_citrix_session && return 1 | ||
68 | |||
69 | # other sanity checks | ||
70 | case "${mode}" in | ||
71 | fullscreen) ;; | ||
72 | seamless) ;; | ||
73 | *x*) ;; | ||
74 | *) help_citrix_session && return 1 ;; | ||
75 | esac | ||
76 | |||
77 | # create citrix session file | ||
78 | ${MCORE_LIBDIR}/citrix-session \ | ||
79 | --add \ | ||
80 | --name "${name}" \ | ||
81 | --session "${session}" \ | ||
82 | --mode "${mode}" \ | ||
83 | --user "${user}" \ | ||
84 | --domain "${domain}" \ | ||
85 | --password "${password}" | ||
86 | ;; | ||
87 | |||
88 | del) | ||
89 | if [[ -n ${name} ]] | ||
90 | then | ||
91 | ${MCORE_LIBDIR}/citrix-session --del --name "${name}" | ||
92 | else | ||
93 | for i in $(NOCOLORS=true ${MCORE_LIBDIR}/citrix-session --print) | ||
94 | do | ||
95 | # basename | ||
96 | name="${i%.*}" | ||
97 | ${MCORE_LIBDIR}/citrix-session --del --name "${name}" | ||
98 | done | ||
99 | fi | ||
100 | ;; | ||
101 | |||
102 | *) help_citrix_session && return 1 ;; | ||
103 | esac | ||
104 | } | ||
105 | |||
106 | get_storefront_session() | ||
107 | { | ||
108 | local action="${CLASS_ARGV[0]}" | ||
109 | |||
110 | [[ -z ${action} ]] && help_citrix_serverlist && return 1 | ||
111 | |||
112 | case "${action}" in | ||
113 | print) ${MCORE_LIBDIR}/citrix-session --print ;; | ||
114 | query) ${MCORE_LIBDIR}/citrix-session --query ;; | ||
115 | *) help_citrix_session && return 1 ;; | ||
116 | esac | ||
117 | } | ||
118 | |||
119 | set_storefront_store() | ||
120 | { | ||
121 | local action="${CLASS_ARGV[0]}" | ||
122 | local store="${CLASS_ARGV[1]}" | ||
123 | local i | ||
124 | |||
125 | [[ -z ${action} ]] && help_storefront_store && return 1 | ||
126 | |||
127 | case "${action}" in | ||
128 | add) ${MCORE_LIBDIR}/storefront-resolver addstore "${store}" ;; | ||
129 | del) | ||
130 | if [[ -n ${store} ]] | ||
131 | then | ||
132 | ${MCORE_LIBDIR}/storefront-resolver delstore "${store}" | ||
133 | else | ||
134 | # delete all items | ||
135 | for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) | ||
136 | do | ||
137 | ${MCORE_LIBDIR}/storefront-resolver delstore "${i}" | ||
138 | done | ||
139 | fi | ||
140 | ;; | ||
141 | *) help_citrix_serverlist && return 1 ;; | ||
142 | esac | ||
143 | } | ||
144 | |||
145 | get_storefront_store() | ||
146 | { | ||
147 | ${MCORE_LIBDIR}/storefront-resolver liststore;; | ||
148 | } |