Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2354 by niro, Mon Aug 24 12:27:10 2015 UTC revision 2603 by niro, Fri Sep 18 13:07:47 2015 UTC
# Line 2  Line 2 
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
# Line 26  help_storefront_store() Line 26  help_storefront_store()
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]"
33   mecho   mecho
34   mecho "set storefront.session [action] [name] [session] [user] [domain] [password]"   mecho "set storefront.session [action] [name] [session] [store] [user] [domain] [password]"
35   mecho "  Adds or delets a storefront session."   mecho "  Adds or delets a storefront session."
36   mecho "  Available actions:"   mecho "  Available actions:"
37   mecho "   add        - adds a new storefront session"   mecho "   add        - adds a new storefront session"
# Line 39  help_storefront_session() Line 39  help_storefront_session()
39   mecho "                if no [name] given, all sessions will be deleted"   mecho "                if no [name] given, all sessions will be deleted"
40   mecho   mecho
41   mecho "   session    - name of the Citrix session"   mecho "   session    - name of the Citrix session"
42     mecho "   store      - storefront store uri"
43   mecho "   user       - user inside the session - optional"   mecho "   user       - user inside the session - optional"
44   mecho "   domain     - logon domain of the user - optional"   mecho "   domain     - logon domain of the user - optional"
45   mecho "   password   - password of the user - optional"   mecho "   password   - password of the user - optional"
# Line 49  set_storefront_session() Line 50  set_storefront_session()
50   local action="${CLASS_ARGV[0]}"   local action="${CLASS_ARGV[0]}"
51   local name="${CLASS_ARGV[1]}"   local name="${CLASS_ARGV[1]}"
52   local session="${CLASS_ARGV[2]}"   local session="${CLASS_ARGV[2]}"
53   local mode="${CLASS_ARGV[3]}"   local store="${CLASS_ARGV[3]}"
54   local user="${CLASS_ARGV[4]}"   local user="${CLASS_ARGV[4]}"
55   local domain="${CLASS_ARGV[5]}"   local domain="${CLASS_ARGV[5]}"
56   local password="${CLASS_ARGV[6]}"   local password="${CLASS_ARGV[6]}"
57   local i   local i
58    
59   [[ -z ${action} ]] && help_citrix_session && return 1   [[ -z ${action} ]] && help_storefront_session && return 1
60    
61   case "${action}" in   case "${action}" in
62   add)   add)
63   # requires name   # requires name
64   [[ -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  
65   # and session   # and session
66   [[ -z ${session} ]] && help_citrix_session && return 1   [[ -z ${session} ]] && help_storefront_session && return 1
67     # and storefront uri
68     [[ -z ${store_uri} ]] && help_storefront_session && return 1
69    
70   # other sanity checks   # create storefront session starter
71   case "${mode}" in   ${MCORE_LIBDIR}/storefront-session \
  fullscreen) ;;  
  seamless) ;;  
  *x*) ;;  
  *) help_citrix_session && return 1 ;;  
  esac  
   
  # create citrix session file  
  ${MCORE_LIBDIR}/citrix-session \  
72   --add \   --add \
73   --name "${name}" \   --name "${name}" \
74   --session "${session}" \   --session "${session}" \
75   --mode "${mode}" \   --store "${store}" \
76   --user "${user}" \   --user "${user}" \
77   --domain "${domain}" \   --domain "${domain}" \
78   --password "${password}"   --password "${password}"
# Line 88  set_storefront_session() Line 81  set_storefront_session()
81   del)   del)
82   if [[ -n ${name} ]]   if [[ -n ${name} ]]
83   then   then
84   ${MCORE_LIBDIR}/citrix-session --del --name "${name}"   ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
85   else   else
86   for i in $(NOCOLORS=true ${MCORE_LIBDIR}/citrix-session --print)   for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/storefront-session --print)
87   do   do
88   # basename   # basename
89   name="${i%.*}"   name="${i%.*}"
90   ${MCORE_LIBDIR}/citrix-session --del --name "${name}"   ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
91   done   done
92   fi   fi
93   ;;   ;;
94    
95   *) help_citrix_session && return 1 ;;   *) help_storefront_session && return 1 ;;
96   esac   esac
97  }  }
98    
99  get_storefront_session()  get_storefront_session()
100  {  {
101   local action="${CLASS_ARGV[0]}"   local action="${CLASS_ARGV[0]}"
102     local user="${CLASS_ARGV[1]}"
103     local domain="${CLASS_ARGV[2]}"
104     local password="${CLASS_ARGV[3]}"
105    
106   [[ -z ${action} ]] && help_citrix_serverlist && return 1   [[ -z ${action} ]] && help_storefront_session && return 1
107    
108   case "${action}" in   case "${action}" in
109   print) ${MCORE_LIBDIR}/citrix-session --print ;;   print) ${MCORE_LIBDIR}/storefront-session --print ;;
110   query) ${MCORE_LIBDIR}/citrix-session --query ;;   query)
111   *) help_citrix_session && return 1 ;;   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     *) help_storefront_session && return 1 ;;
119   esac   esac
120  }  }
121    
122    #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  set_storefront_store()  set_storefront_store()
154  {  {
155   local action="${CLASS_ARGV[0]}"   local action="${CLASS_ARGV[0]}"
# Line 125  set_storefront_store() Line 159  set_storefront_store()
159   [[ -z ${action} ]] && help_storefront_store && return 1   [[ -z ${action} ]] && help_storefront_store && return 1
160    
161   case "${action}" in   case "${action}" in
162   add) ${MCORE_LIBDIR}/storefront-resolver addstore "${store}" ;;   add)
163     [[ -z ${store} ]] && help_storefront_store && return 1
164     ${MCORE_LIBDIR}/storefront-store --add --store "${store}"
165     ;;
166    
167   del)   del)
168   if [[ -n ${store} ]]   if [[ -n ${store} ]]
169   then   then
170   ${MCORE_LIBDIR}/storefront-resolver delstore "${store}"   ${MCORE_LIBDIR}/storefront-store --del --store "${store}"
171   else   else
172   # delete all items   # delete all items
173   for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore)   ${MCORE_LIBDIR}/storefront-store --del
  do  
  ${MCORE_LIBDIR}/storefront-resolver delstore "${i}"  
  done  
174   fi   fi
175   ;;   ;;
176   *) help_citrix_serverlist && return 1 ;;  
177     *) help_storefront_store && return 1 ;;
178   esac   esac
179  }  }
180    
181  get_storefront_store()  get_storefront_store()
182  {  {
183   ${MCORE_LIBDIR}/storefront-resolver liststore;;   ${MCORE_LIBDIR}/storefront-store --print
184  }  }

Legend:
Removed from v.2354  
changed lines
  Added in v.2603