Contents of /mcore-src/trunk/mcore-tools/src/modules/citrix/storefront.client.class.in
Parent Directory | Revision Log
Revision 2642 -
(show annotations)
(download)
Thu Oct 8 10:23:56 2015 UTC (8 years, 11 months ago) by niro
File size: 4831 byte(s)
Thu Oct 8 10:23:56 2015 UTC (8 years, 11 months ago) by niro
File size: 4831 byte(s)
-added autostart option
1 | # $Id$ |
2 | |
3 | provide citrix storefront |
4 | |
5 | # needs fluxbox and idesk! |
6 | require fluxbox idesk |
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 [action] [user] [domain] [password]" |
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] [store] [user] [domain] [password] [autostart]" |
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 " store - storefront store uri" |
43 | mecho " user - user inside the session - optional" |
44 | mecho " domain - logon domain of the user - optional" |
45 | mecho " password - password of the user - optional" |
46 | mecho " autostart - session autostart 0=off 1=on- optional" |
47 | } |
48 | |
49 | set_storefront_session() |
50 | { |
51 | local action="${CLASS_ARGV[0]}" |
52 | local name="${CLASS_ARGV[1]}" |
53 | local session="${CLASS_ARGV[2]}" |
54 | local store="${CLASS_ARGV[3]}" |
55 | local user="${CLASS_ARGV[4]}" |
56 | local domain="${CLASS_ARGV[5]}" |
57 | local password="${CLASS_ARGV[6]}" |
58 | local autostart="${CLASS_ARGV[7]}" |
59 | local i |
60 | |
61 | [[ -z ${action} ]] && help_storefront_session && return 1 |
62 | |
63 | case "${action}" in |
64 | add) |
65 | # requires name |
66 | [[ -z ${name} ]] && help_storefront_session && return 1 |
67 | # and session |
68 | [[ -z ${session} ]] && help_storefront_session && return 1 |
69 | # and storefront uri |
70 | [[ -z ${store} ]] && help_storefront_session && return 1 |
71 | |
72 | # create storefront session starter |
73 | ${MCORE_LIBDIR}/storefront-session \ |
74 | --add \ |
75 | --name "${name}" \ |
76 | --session "${session}" \ |
77 | --store "${store}" \ |
78 | --user "${user}" \ |
79 | --domain "${domain}" \ |
80 | --password "${password}" \ |
81 | --autostart "${autostart}" |
82 | ;; |
83 | |
84 | del) |
85 | if [[ -n ${name} ]] |
86 | then |
87 | ${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
88 | else |
89 | for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/storefront-session --print) |
90 | do |
91 | # basename |
92 | name="${i%.*}" |
93 | ${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
94 | done |
95 | fi |
96 | ;; |
97 | |
98 | *) help_storefront_session && return 1 ;; |
99 | esac |
100 | } |
101 | |
102 | get_storefront_session() |
103 | { |
104 | local action="${CLASS_ARGV[0]}" |
105 | local user="${CLASS_ARGV[1]}" |
106 | local domain="${CLASS_ARGV[2]}" |
107 | local password="${CLASS_ARGV[3]}" |
108 | |
109 | [[ -z ${action} ]] && help_storefront_session && return 1 |
110 | |
111 | case "${action}" in |
112 | print) ${MCORE_LIBDIR}/storefront-session --print ;; |
113 | query) |
114 | if [[ -n ${user} ]] |
115 | then |
116 | ${MCORE_LIBDIR}/storefront-session --query --user "${user}" --domain "${domain}" --password "${password}" |
117 | else |
118 | ${MCORE_LIBDIR}/storefront-session --query |
119 | fi |
120 | ;; |
121 | *) help_storefront_session && return 1 ;; |
122 | esac |
123 | } |
124 | |
125 | #set_storefront_store() |
126 | #{ |
127 | #local action="${CLASS_ARGV[0]}" |
128 | #local store="${CLASS_ARGV[1]}" |
129 | #local i |
130 | |
131 | #[[ -z ${action} ]] && help_storefront_store && return 1 |
132 | |
133 | #case "${action}" in |
134 | #add) x11runas "${MCORE_LIBDIR}/storefront-resolver --addstore --store '${store}'" ;; |
135 | #del) |
136 | #if [[ -n ${store} ]] |
137 | #then |
138 | #x11runas "${MCORE_LIBDIR}/storefront-resolver --delstore --store '${store}'" |
139 | #else |
140 | ## delete all items |
141 | #for i in $(x11runas "NOCOLORS=1 ${MCORE_LIBDIR}/storefront-resolver --liststore") |
142 | #do |
143 | #x11runas "${MCORE_LIBDIR}/storefront-resolver --delstore --store '${i}'" |
144 | #done |
145 | #fi |
146 | #;; |
147 | #*) help_storefront_store && return 1 ;; |
148 | #esac |
149 | #} |
150 | |
151 | #get_storefront_store() |
152 | #{ |
153 | #x11runas "${MCORE_LIBDIR}/storefront-resolver --liststore" |
154 | #} |
155 | |
156 | set_storefront_store() |
157 | { |
158 | local action="${CLASS_ARGV[0]}" |
159 | local store="${CLASS_ARGV[1]}" |
160 | local i |
161 | |
162 | [[ -z ${action} ]] && help_storefront_store && return 1 |
163 | |
164 | case "${action}" in |
165 | add) |
166 | [[ -z ${store} ]] && help_storefront_store && return 1 |
167 | ${MCORE_LIBDIR}/storefront-store --add --store "${store}" |
168 | ;; |
169 | |
170 | del) |
171 | if [[ -n ${store} ]] |
172 | then |
173 | ${MCORE_LIBDIR}/storefront-store --del --store "${store}" |
174 | else |
175 | # delete all items |
176 | ${MCORE_LIBDIR}/storefront-store --del |
177 | fi |
178 | ;; |
179 | |
180 | *) help_storefront_store && return 1 ;; |
181 | esac |
182 | } |
183 | |
184 | get_storefront_store() |
185 | { |
186 | ${MCORE_LIBDIR}/storefront-store --print |
187 | } |