Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2604 - (hide 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 niro 2354 # $Id$
2    
3     provide citrix storefront
4    
5 niro 2386 # needs fluxbox and idesk!
6     require fluxbox idesk
7 niro 2354
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 niro 2357 mecho "get storefront.session [action] [user] [domain] [password]"
30 niro 2354 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 niro 2602 mecho "set storefront.session [action] [name] [session] [store] [user] [domain] [password]"
35 niro 2354 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 niro 2602 mecho " store - storefront store uri"
43 niro 2354 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 niro 2603 local store="${CLASS_ARGV[3]}"
54 niro 2593 local user="${CLASS_ARGV[4]}"
55     local domain="${CLASS_ARGV[5]}"
56     local password="${CLASS_ARGV[6]}"
57 niro 2354 local i
58    
59 niro 2385 [[ -z ${action} ]] && help_storefront_session && return 1
60 niro 2354
61     case "${action}" in
62     add)
63     # requires name
64 niro 2355 [[ -z ${name} ]] && help_storefront_session && return 1
65 niro 2354 # and session
66 niro 2355 [[ -z ${session} ]] && help_storefront_session && return 1
67 niro 2593 # and storefront uri
68 niro 2604 [[ -z ${store} ]] && help_storefront_session && return 1
69 niro 2354
70 niro 2355 # create storefront session starter
71     ${MCORE_LIBDIR}/storefront-session \
72 niro 2354 --add \
73     --name "${name}" \
74     --session "${session}" \
75 niro 2603 --store "${store}" \
76 niro 2354 --user "${user}" \
77     --domain "${domain}" \
78     --password "${password}"
79     ;;
80    
81     del)
82     if [[ -n ${name} ]]
83     then
84 niro 2355 ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
85 niro 2354 else
86 niro 2479 for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/storefront-session --print)
87 niro 2354 do
88     # basename
89     name="${i%.*}"
90 niro 2355 ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
91 niro 2354 done
92     fi
93     ;;
94    
95 niro 2355 *) help_storefront_session && return 1 ;;
96 niro 2354 esac
97     }
98    
99     get_storefront_session()
100     {
101     local action="${CLASS_ARGV[0]}"
102 niro 2357 local user="${CLASS_ARGV[1]}"
103     local domain="${CLASS_ARGV[2]}"
104     local password="${CLASS_ARGV[3]}"
105 niro 2354
106 niro 2355 [[ -z ${action} ]] && help_storefront_session && return 1
107 niro 2354
108     case "${action}" in
109 niro 2355 print) ${MCORE_LIBDIR}/storefront-session --print ;;
110 niro 2357 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 niro 2385 *) help_storefront_session && return 1 ;;
119 niro 2354 esac
120     }
121    
122 niro 2593 #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 niro 2354 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 niro 2593 add)
163     [[ -z ${store} ]] && help_storefront_store && return 1
164     ${MCORE_LIBDIR}/storefront-store --add --store "${store}"
165     ;;
166    
167 niro 2354 del)
168     if [[ -n ${store} ]]
169     then
170 niro 2593 ${MCORE_LIBDIR}/storefront-store --del --store "${store}"
171 niro 2354 else
172     # delete all items
173 niro 2593 ${MCORE_LIBDIR}/storefront-store --del
174 niro 2354 fi
175     ;;
176 niro 2593
177 niro 2384 *) help_storefront_store && return 1 ;;
178 niro 2354 esac
179     }
180    
181     get_storefront_store()
182     {
183 niro 2593 ${MCORE_LIBDIR}/storefront-store --print
184 niro 2354 }