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 |
26 |
|
|
27 |
help_storefront_session() |
help_storefront_session() |
28 |
{ |
{ |
29 |
mecho "get storefront.session" |
mecho "get storefront.session [action] [user] [domain] [password]" |
30 |
mecho " Shows all configured storefront sessions" |
mecho " Shows all configured storefront sessions" |
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]" |
49 |
local action="${CLASS_ARGV[0]}" |
local action="${CLASS_ARGV[0]}" |
50 |
local name="${CLASS_ARGV[1]}" |
local name="${CLASS_ARGV[1]}" |
51 |
local session="${CLASS_ARGV[2]}" |
local session="${CLASS_ARGV[2]}" |
52 |
local mode="${CLASS_ARGV[3]}" |
local user="${CLASS_ARGV[3]}" |
53 |
local user="${CLASS_ARGV[4]}" |
local domain="${CLASS_ARGV[4]}" |
54 |
local domain="${CLASS_ARGV[5]}" |
local password="${CLASS_ARGV[5]}" |
|
local password="${CLASS_ARGV[6]}" |
|
55 |
local i |
local i |
56 |
|
|
57 |
[[ -z ${action} ]] && help_citrix_session && return 1 |
[[ -z ${action} ]] && help_storefront_session && return 1 |
58 |
|
|
59 |
case "${action}" in |
case "${action}" in |
60 |
add) |
add) |
61 |
# requires name |
# requires name |
62 |
[[ -z ${name} ]] && help_citrix_session && return 1 |
[[ -z ${name} ]] && help_storefront_session && return 1 |
|
# action 'add' need mode too |
|
|
[[ -z ${mode} ]] && help_citrix_session && return 1 |
|
63 |
# and session |
# and session |
64 |
[[ -z ${session} ]] && help_citrix_session && return 1 |
[[ -z ${session} ]] && help_storefront_session && return 1 |
65 |
|
|
66 |
# other sanity checks |
# create storefront session starter |
67 |
case "${mode}" in |
${MCORE_LIBDIR}/storefront-session \ |
|
fullscreen) ;; |
|
|
seamless) ;; |
|
|
*x*) ;; |
|
|
*) help_citrix_session && return 1 ;; |
|
|
esac |
|
|
|
|
|
# create citrix session file |
|
|
${MCORE_LIBDIR}/citrix-session \ |
|
68 |
--add \ |
--add \ |
69 |
--name "${name}" \ |
--name "${name}" \ |
70 |
--session "${session}" \ |
--session "${session}" \ |
|
--mode "${mode}" \ |
|
71 |
--user "${user}" \ |
--user "${user}" \ |
72 |
--domain "${domain}" \ |
--domain "${domain}" \ |
73 |
--password "${password}" |
--password "${password}" |
76 |
del) |
del) |
77 |
if [[ -n ${name} ]] |
if [[ -n ${name} ]] |
78 |
then |
then |
79 |
${MCORE_LIBDIR}/citrix-session --del --name "${name}" |
${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
80 |
else |
else |
81 |
for i in $(NOCOLORS=true ${MCORE_LIBDIR}/citrix-session --print) |
for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-session --print) |
82 |
do |
do |
83 |
# basename |
# basename |
84 |
name="${i%.*}" |
name="${i%.*}" |
85 |
${MCORE_LIBDIR}/citrix-session --del --name "${name}" |
${MCORE_LIBDIR}/storefront-session --del --name "${name}" |
86 |
done |
done |
87 |
fi |
fi |
88 |
;; |
;; |
89 |
|
|
90 |
*) help_citrix_session && return 1 ;; |
*) help_storefront_session && return 1 ;; |
91 |
esac |
esac |
92 |
} |
} |
93 |
|
|
94 |
get_storefront_session() |
get_storefront_session() |
95 |
{ |
{ |
96 |
local action="${CLASS_ARGV[0]}" |
local action="${CLASS_ARGV[0]}" |
97 |
|
local user="${CLASS_ARGV[1]}" |
98 |
|
local domain="${CLASS_ARGV[2]}" |
99 |
|
local password="${CLASS_ARGV[3]}" |
100 |
|
|
101 |
[[ -z ${action} ]] && help_citrix_serverlist && return 1 |
[[ -z ${action} ]] && help_storefront_session && return 1 |
102 |
|
|
103 |
case "${action}" in |
case "${action}" in |
104 |
print) ${MCORE_LIBDIR}/citrix-session --print ;; |
print) ${MCORE_LIBDIR}/storefront-session --print ;; |
105 |
query) ${MCORE_LIBDIR}/citrix-session --query ;; |
query) |
106 |
*) help_citrix_session && return 1 ;; |
if [[ -n ${user} ]] |
107 |
|
then |
108 |
|
${MCORE_LIBDIR}/storefront-session --query --user "${user}" --domain "${domain}" --password "${password}" |
109 |
|
else |
110 |
|
${MCORE_LIBDIR}/storefront-session --query |
111 |
|
fi |
112 |
|
;; |
113 |
|
*) help_storefront_session && return 1 ;; |
114 |
esac |
esac |
115 |
} |
} |
116 |
|
|
123 |
[[ -z ${action} ]] && help_storefront_store && return 1 |
[[ -z ${action} ]] && help_storefront_store && return 1 |
124 |
|
|
125 |
case "${action}" in |
case "${action}" in |
126 |
add) ${MCORE_LIBDIR}/storefront-resolver addstore "${store}" ;; |
add) x11runas "${MCORE_LIBDIR}/storefront-resolver addstore '${store}'" ;; |
127 |
del) |
del) |
128 |
if [[ -n ${store} ]] |
if [[ -n ${store} ]] |
129 |
then |
then |
130 |
${MCORE_LIBDIR}/storefront-resolver delstore "${store}" |
x11runas "${MCORE_LIBDIR}/storefront-resolver delstore '${store}'" |
131 |
else |
else |
132 |
# delete all items |
# delete all items |
133 |
for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) |
for i in $(x11runas "NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore") |
134 |
do |
do |
135 |
${MCORE_LIBDIR}/storefront-resolver delstore "${i}" |
x11runas "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'" |
136 |
done |
done |
137 |
fi |
fi |
138 |
;; |
;; |
139 |
*) help_citrix_serverlist && return 1 ;; |
*) help_storefront_store && return 1 ;; |
140 |
esac |
esac |
141 |
} |
} |
142 |
|
|
143 |
get_storefront_store() |
get_storefront_store() |
144 |
{ |
{ |
145 |
${MCORE_LIBDIR}/storefront-resolver liststore;; |
x11runas "${MCORE_LIBDIR}/storefront-resolver liststore" |
146 |
} |
} |