Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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