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_citrix_session && return 1 |
60 |
add) |
add) |
61 |
# requires name |
# requires name |
62 |
[[ -z ${name} ]] && help_storefront_session && return 1 |
[[ -z ${name} ]] && help_storefront_session && return 1 |
|
# action 'add' need mode too |
|
|
[[ -z ${mode} ]] && help_storefront_session && return 1 |
|
63 |
# and session |
# and session |
64 |
[[ -z ${session} ]] && help_storefront_session && return 1 |
[[ -z ${session} ]] && help_storefront_session && return 1 |
65 |
|
|
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_storefront_session && return 1 |
[[ -z ${action} ]] && help_storefront_session && return 1 |
102 |
|
|
103 |
case "${action}" in |
case "${action}" in |
104 |
print) ${MCORE_LIBDIR}/storefront-session --print ;; |
print) ${MCORE_LIBDIR}/storefront-session --print ;; |
105 |
query) ${MCORE_LIBDIR}/storefront-session --query ;; |
query) |
106 |
|
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_citrix_session && return 1 ;; |
*) help_citrix_session && return 1 ;; |
114 |
esac |
esac |
115 |
} |
} |
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) su - "${MCORE_UNPRIV_USER}" -c "${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}" |
su - "${MCORE_UNPRIV_USER}" -c "${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 $(su - "${MCORE_UNPRIV_USER}" -c NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore) |
134 |
do |
do |
135 |
${MCORE_LIBDIR}/storefront-resolver delstore "${i}" |
su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'" |
136 |
done |
done |
137 |
fi |
fi |
138 |
;; |
;; |
142 |
|
|
143 |
get_storefront_store() |
get_storefront_store() |
144 |
{ |
{ |
145 |
${MCORE_LIBDIR}/storefront-resolver liststore |
su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver liststore" |
146 |
} |
} |