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 2355 by niro, Mon Aug 24 12:32:07 2015 UTC revision 2390 by niro, Thu Aug 27 07:33:24 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]"
# Line 49  set_storefront_session() Line 49  set_storefront_session()
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_storefront_session && return 1
58    
59   case "${action}" in   case "${action}" in
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    
# Line 97  set_storefront_session() Line 94  set_storefront_session()
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   *) help_citrix_session && return 1 ;;   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_storefront_session && return 1 ;;
114   esac   esac
115  }  }
116    
# Line 116  set_storefront_store() Line 123  set_storefront_store()
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) x11runas "${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}"   x11runas "${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 $(x11runas "NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore")
134   do   do
135   ${MCORE_LIBDIR}/storefront-resolver delstore "${i}"   x11runas "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'"
136   done   done
137   fi   fi
138   ;;   ;;
139   *) help_citrix_serverlist && return 1 ;;   *) help_storefront_store && return 1 ;;
140   esac   esac
141  }  }
142    
143  get_storefront_store()  get_storefront_store()
144  {  {
145   ${MCORE_LIBDIR}/storefront-resolver liststore   x11runas "${MCORE_LIBDIR}/storefront-resolver liststore"
146  }  }

Legend:
Removed from v.2355  
changed lines
  Added in v.2390