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 2386 by niro, Wed Aug 26 12:18:06 2015 UTC revision 2728 by niro, Thu Jan 28 14:21:05 2016 UTC
# Line 31  help_storefront_session() Line 31  help_storefront_session()
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] [autostart]"
35   mecho "  Adds or delets a storefront session."   mecho "  Adds or deletes 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"
38   mecho "   del        - deletes storefront session with name [name]"   mecho "   del        - deletes a storefront session named [name]"
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"
46     mecho "   autostart  - session autostart 0=off 1=on- optional"
47  }  }
48    
49  set_storefront_session()  set_storefront_session()
# Line 49  set_storefront_session() Line 51  set_storefront_session()
51   local action="${CLASS_ARGV[0]}"   local action="${CLASS_ARGV[0]}"
52   local name="${CLASS_ARGV[1]}"   local name="${CLASS_ARGV[1]}"
53   local session="${CLASS_ARGV[2]}"   local session="${CLASS_ARGV[2]}"
54   local user="${CLASS_ARGV[3]}"   local store="${CLASS_ARGV[3]}"
55   local domain="${CLASS_ARGV[4]}"   local user="${CLASS_ARGV[4]}"
56   local password="${CLASS_ARGV[5]}"   local domain="${CLASS_ARGV[5]}"
57     local password="${CLASS_ARGV[6]}"
58     local autostart="${CLASS_ARGV[7]}"
59   local i   local i
60    
61   [[ -z ${action} ]] && help_storefront_session && return 1   [[ -z ${action} ]] && help_storefront_session && return 1
# Line 62  set_storefront_session() Line 66  set_storefront_session()
66   [[ -z ${name} ]] && help_storefront_session && return 1   [[ -z ${name} ]] && help_storefront_session && return 1
67   # and session   # and session
68   [[ -z ${session} ]] && help_storefront_session && return 1   [[ -z ${session} ]] && help_storefront_session && return 1
69     # and storefront uri
70     [[ -z ${store} ]] && help_storefront_session && return 1
71    
72   # create storefront session starter   # create storefront session starter
73   ${MCORE_LIBDIR}/storefront-session \   ${MCORE_LIBDIR}/storefront-session \
74   --add \   --add \
75   --name "${name}" \   --name "${name}" \
76   --session "${session}" \   --session "${session}" \
77     --store "${store}" \
78   --user "${user}" \   --user "${user}" \
79   --domain "${domain}" \   --domain "${domain}" \
80   --password "${password}"   --password "${password}" \
81     --autostart "${autostart}"
82   ;;   ;;
83    
84   del)   del)
# Line 78  set_storefront_session() Line 86  set_storefront_session()
86   then   then
87   ${MCORE_LIBDIR}/storefront-session --del --name "${name}"   ${MCORE_LIBDIR}/storefront-session --del --name "${name}"
88   else   else
89   for i in $(NOCOLORS=true ${MCORE_LIBDIR}/storefront-session --print)   for i in $(NOCOLORS=1 ${MCORE_LIBDIR}/storefront-session --print)
90   do   do
91   # basename   # basename
92   name="${i%.*}"   name="${i%.*}"
# Line 114  get_storefront_session() Line 122  get_storefront_session()
122   esac   esac
123  }  }
124    
125    #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  set_storefront_store()  set_storefront_store()
157  {  {
158   local action="${CLASS_ARGV[0]}"   local action="${CLASS_ARGV[0]}"
# Line 123  set_storefront_store() Line 162  set_storefront_store()
162   [[ -z ${action} ]] && help_storefront_store && return 1   [[ -z ${action} ]] && help_storefront_store && return 1
163    
164   case "${action}" in   case "${action}" in
165   add) su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver addstore '${store}'" ;;   add)
166     [[ -z ${store} ]] && help_storefront_store && return 1
167     ${MCORE_LIBDIR}/storefront-store --add --store "${store}"
168     ;;
169    
170   del)   del)
171   if [[ -n ${store} ]]   if [[ -n ${store} ]]
172   then   then
173   su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${store}'"   ${MCORE_LIBDIR}/storefront-store --del --store "${store}"
174   else   else
175   # delete all items   # delete all items
176   for i in $(su - "${MCORE_UNPRIV_USER}" -c NOCOLORS=true ${MCORE_LIBDIR}/storefront-resolver liststore)   ${MCORE_LIBDIR}/storefront-store --del
  do  
  su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver delstore '${i}'"  
  done  
177   fi   fi
178   ;;   ;;
179    
180   *) help_storefront_store && return 1 ;;   *) help_storefront_store && return 1 ;;
181   esac   esac
182  }  }
183    
184  get_storefront_store()  get_storefront_store()
185  {  {
186   su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver liststore"   ${MCORE_LIBDIR}/storefront-store --print
187  }  }

Legend:
Removed from v.2386  
changed lines
  Added in v.2728