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 2356 by niro, Mon Aug 24 12:32:07 2015 UTC revision 2357 by niro, Mon Aug 24 14:11:55 2015 UTC
# 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_citrix_session && return 1
# Line 61  set_storefront_session() Line 60  set_storefront_session()
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     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_citrix_session && return 1 ;;   *) help_citrix_session && return 1 ;;
114   esac   esac
115  }  }
# 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) su - "${MCORE_UNPRIV_USER}" -c "${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}"   su - "${MCORE_UNPRIV_USER}" -c "${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 $(su - "${MCORE_UNPRIV_USER}" -c NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore)
134   do   do
135   ${MCORE_LIBDIR}/storefront-resolver delstore "${i}"   su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'"
136   done   done
137   fi   fi
138   ;;   ;;
# Line 135  set_storefront_store() Line 142  set_storefront_store()
142    
143  get_storefront_store()  get_storefront_store()
144  {  {
145   ${MCORE_LIBDIR}/storefront-resolver liststore   su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver liststore"
146  }  }

Legend:
Removed from v.2356  
changed lines
  Added in v.2357