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 2355 - (hide annotations) (download)
Mon Aug 24 12:32:07 2015 UTC (8 years, 8 months ago) by niro
File size: 3574 byte(s)
-fixups
1 niro 2354 # $Id$
2    
3     provide citrix storefront
4    
5     # needs fluxbox!
6     require fluxbox basic-video
7    
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     mecho "get storefront.session"
30     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     mecho "set storefront.session [action] [name] [session] [user] [domain] [password]"
35     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     mecho " user - user inside the session - optional"
43     mecho " domain - logon domain of the user - optional"
44     mecho " password - password of the user - optional"
45     }
46    
47     set_storefront_session()
48     {
49     local action="${CLASS_ARGV[0]}"
50     local name="${CLASS_ARGV[1]}"
51     local session="${CLASS_ARGV[2]}"
52     local mode="${CLASS_ARGV[3]}"
53     local user="${CLASS_ARGV[4]}"
54     local domain="${CLASS_ARGV[5]}"
55     local password="${CLASS_ARGV[6]}"
56     local i
57    
58     [[ -z ${action} ]] && help_citrix_session && return 1
59    
60     case "${action}" in
61     add)
62     # requires name
63 niro 2355 [[ -z ${name} ]] && help_storefront_session && return 1
64 niro 2354 # action 'add' need mode too
65 niro 2355 [[ -z ${mode} ]] && help_storefront_session && return 1
66 niro 2354 # and session
67 niro 2355 [[ -z ${session} ]] && help_storefront_session && return 1
68 niro 2354
69 niro 2355 # create storefront session starter
70     ${MCORE_LIBDIR}/storefront-session \
71 niro 2354 --add \
72     --name "${name}" \
73     --session "${session}" \
74     --user "${user}" \
75     --domain "${domain}" \
76     --password "${password}"
77     ;;
78    
79     del)
80     if [[ -n ${name} ]]
81     then
82 niro 2355 ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
83 niro 2354 else
84 niro 2355 for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-session --print)
85 niro 2354 do
86     # basename
87     name="${i%.*}"
88 niro 2355 ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
89 niro 2354 done
90     fi
91     ;;
92    
93 niro 2355 *) help_storefront_session && return 1 ;;
94 niro 2354 esac
95     }
96    
97     get_storefront_session()
98     {
99     local action="${CLASS_ARGV[0]}"
100    
101 niro 2355 [[ -z ${action} ]] && help_storefront_session && return 1
102 niro 2354
103     case "${action}" in
104 niro 2355 print) ${MCORE_LIBDIR}/storefront-session --print ;;
105     query) ${MCORE_LIBDIR}/storefront-session --query ;;
106 niro 2354 *) help_citrix_session && return 1 ;;
107     esac
108     }
109    
110     set_storefront_store()
111     {
112     local action="${CLASS_ARGV[0]}"
113     local store="${CLASS_ARGV[1]}"
114     local i
115    
116     [[ -z ${action} ]] && help_storefront_store && return 1
117    
118     case "${action}" in
119     add) ${MCORE_LIBDIR}/storefront-resolver addstore "${store}" ;;
120     del)
121     if [[ -n ${store} ]]
122     then
123     ${MCORE_LIBDIR}/storefront-resolver delstore "${store}"
124     else
125     # delete all items
126     for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore)
127     do
128     ${MCORE_LIBDIR}/storefront-resolver delstore "${i}"
129     done
130     fi
131     ;;
132     *) help_citrix_serverlist && return 1 ;;
133     esac
134     }
135    
136     get_storefront_store()
137     {
138 niro 2355 ${MCORE_LIBDIR}/storefront-resolver liststore
139 niro 2354 }