2 |
|
|
3 |
provide citrix storefront |
provide citrix storefront |
4 |
|
|
5 |
# needs fluxbox! |
# needs fluxbox and idesk! |
6 |
require fluxbox basic-video |
require fluxbox idesk |
7 |
|
|
8 |
# citrix global config |
# citrix global config |
9 |
include @@SYSCONFDIR@@/mcore/citrix.conf |
include @@SYSCONFDIR@@/mcore/citrix.conf |
31 |
mecho " print - prints all local configured sessions" |
mecho " print - prints all local configured sessions" |
32 |
mecho " query - get sessionlist of the farm from given [server]" |
mecho " query - get sessionlist of the farm from given [server]" |
33 |
mecho |
mecho |
34 |
mecho "set storefront.session [action] [name] [session] [user] [domain] [password]" |
mecho "set storefront.session [action] [name] [session] [store] [user] [domain] [password]" |
35 |
mecho " Adds or delets a storefront session." |
mecho " Adds or delets a storefront session." |
36 |
mecho " Available actions:" |
mecho " Available actions:" |
37 |
mecho " add - adds a new storefront session" |
mecho " add - adds a new storefront session" |
39 |
mecho " if no [name] given, all sessions will be deleted" |
mecho " if no [name] given, all sessions will be deleted" |
40 |
mecho |
mecho |
41 |
mecho " session - name of the Citrix session" |
mecho " session - name of the Citrix session" |
42 |
|
mecho " store - storefront store uri" |
43 |
mecho " user - user inside the session - optional" |
mecho " user - user inside the session - optional" |
44 |
mecho " domain - logon domain of the user - optional" |
mecho " domain - logon domain of the user - optional" |
45 |
mecho " password - password of the user - optional" |
mecho " password - password of the user - optional" |
50 |
local action="${CLASS_ARGV[0]}" |
local action="${CLASS_ARGV[0]}" |
51 |
local name="${CLASS_ARGV[1]}" |
local name="${CLASS_ARGV[1]}" |
52 |
local session="${CLASS_ARGV[2]}" |
local session="${CLASS_ARGV[2]}" |
53 |
local user="${CLASS_ARGV[3]}" |
local store_uri="${CLASS_ARGV[3]}" |
54 |
local domain="${CLASS_ARGV[4]}" |
local user="${CLASS_ARGV[4]}" |
55 |
local password="${CLASS_ARGV[5]}" |
local domain="${CLASS_ARGV[5]}" |
56 |
|
local password="${CLASS_ARGV[6]}" |
57 |
local i |
local i |
58 |
|
|
59 |
[[ -z ${action} ]] && help_citrix_session && return 1 |
[[ -z ${action} ]] && help_storefront_session && return 1 |
60 |
|
|
61 |
case "${action}" in |
case "${action}" in |
62 |
add) |
add) |
64 |
[[ -z ${name} ]] && help_storefront_session && return 1 |
[[ -z ${name} ]] && help_storefront_session && return 1 |
65 |
# and session |
# and session |
66 |
[[ -z ${session} ]] && help_storefront_session && return 1 |
[[ -z ${session} ]] && help_storefront_session && return 1 |
67 |
|
# and storefront uri |
68 |
|
[[ -z ${store_uri} ]] && help_storefront_session && return 1 |
69 |
|
|
70 |
# create storefront session starter |
# create storefront session starter |
71 |
${MCORE_LIBDIR}/storefront-session \ |
${MCORE_LIBDIR}/storefront-session \ |
72 |
--add \ |
--add \ |
73 |
--name "${name}" \ |
--name "${name}" \ |
74 |
--session "${session}" \ |
--session "${session}" \ |
75 |
|
--store_uri "${store_uri}" \ |
76 |
--user "${user}" \ |
--user "${user}" \ |
77 |
--domain "${domain}" \ |
--domain "${domain}" \ |
78 |
--password "${password}" |
--password "${password}" |
83 |
then |
then |
84 |
${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
85 |
else |
else |
86 |
for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-session --print) |
for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/storefront-session --print) |
87 |
do |
do |
88 |
# basename |
# basename |
89 |
name="${i%.*}" |
name="${i%.*}" |
115 |
${MCORE_LIBDIR}/storefront-session --query |
${MCORE_LIBDIR}/storefront-session --query |
116 |
fi |
fi |
117 |
;; |
;; |
118 |
*) help_citrix_session && return 1 ;; |
*) help_storefront_session && return 1 ;; |
119 |
esac |
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() |
set_storefront_store() |
154 |
{ |
{ |
155 |
local action="${CLASS_ARGV[0]}" |
local action="${CLASS_ARGV[0]}" |
159 |
[[ -z ${action} ]] && help_storefront_store && return 1 |
[[ -z ${action} ]] && help_storefront_store && return 1 |
160 |
|
|
161 |
case "${action}" in |
case "${action}" in |
162 |
add) su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver addstore '${store}'" ;; |
add) |
163 |
|
[[ -z ${store} ]] && help_storefront_store && return 1 |
164 |
|
${MCORE_LIBDIR}/storefront-store --add --store "${store}" |
165 |
|
;; |
166 |
|
|
167 |
del) |
del) |
168 |
if [[ -n ${store} ]] |
if [[ -n ${store} ]] |
169 |
then |
then |
170 |
su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${store}'" |
${MCORE_LIBDIR}/storefront-store --del --store "${store}" |
171 |
else |
else |
172 |
# delete all items |
# delete all items |
173 |
for i in $(su - "${MCORE_UNPRIV_USER}" -c NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) |
${MCORE_LIBDIR}/storefront-store --del |
|
do |
|
|
su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'" |
|
|
done |
|
174 |
fi |
fi |
175 |
;; |
;; |
176 |
*) help_citrix_serverlist && return 1 ;; |
|
177 |
|
*) help_storefront_store && return 1 ;; |
178 |
esac |
esac |
179 |
} |
} |
180 |
|
|
181 |
get_storefront_store() |
get_storefront_store() |
182 |
{ |
{ |
183 |
su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver liststore" |
${MCORE_LIBDIR}/storefront-store --print |
184 |
} |
} |