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