Magellan Linux

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

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

revision 2602 by niro, Fri Sep 18 12:47:54 2015 UTC revision 2603 by niro, Fri Sep 18 13:07:47 2015 UTC
# Line 24  normalize_store() Line 24  normalize_store()
24  generate_storefront_xml()  generate_storefront_xml()
25  {  {
26   local config   local config
27   local store_uri   local store
28   local xml   local xml
29    
30   install -o "${MCORE_UNPRIV_USER}" -g "${MCORE_UNPRIV_GROUP}" -d "${MCORE_UNPRIV_HOME}/.ICAClient/cache/Stores"   install -o "${MCORE_UNPRIV_USER}" -g "${MCORE_UNPRIV_GROUP}" -d "${MCORE_UNPRIV_HOME}/.ICAClient/cache/Stores"
# Line 34  generate_storefront_xml() Line 34  generate_storefront_xml()
34   if [[ -L ${STOREFRONT_DIR}/default-store ]]   if [[ -L ${STOREFRONT_DIR}/default-store ]]
35   then   then
36   store_uri=$(source ${STOREFRONT_DIR}/default-store; echo "${STORE}")   store_uri=$(source ${STOREFRONT_DIR}/default-store; echo "${STORE}")
37   addconfig "   <DefaultStore>${store_uri}</DefaultStore>"   addconfig "   <DefaultStore>${store}</DefaultStore>"
38   else   else
39   # use the first one which gets found   # use the first one which gets found
40   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})
41   do   do
42   store_uri=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")   store=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")
43   if [[ -n ${store_uri} ]]   if [[ -n ${store} ]]
44   then   then
45   addconfig "   <DefaultStore>${store_uri}</DefaultStore>"   addconfig "   <DefaultStore>${store}</DefaultStore>"
46   break   break
47   fi   fi
48   done   done
# Line 56  generate_storefront_xml() Line 56  generate_storefront_xml()
56   addconfig '   <VisibleStores>'   addconfig '   <VisibleStores>'
57   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})
58   do   do
59   store_uri=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")   store=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")
60   if [[ -n ${store_uri} ]]   if [[ -n ${store} ]]
61   then   then
62   addconfig "      <Store name=\"${store_uri}\" type=\"PNA\">"   addconfig "      <Store name=\"${store}\" type=\"PNA\">"
63   addconfig "         ${store_uri}"   addconfig "         ${store}"
64   addconfig '      </Store>'   addconfig '      </Store>'
65   fi   fi
66   done   done
# Line 88  install -d "${STOREFRONT_STORES_DIR}" Line 88  install -d "${STOREFRONT_STORES_DIR}"
88  case "${method}" in  case "${method}" in
89   add)   add)
90   # requires name and store   # requires name and store
91   [[ -n ${store_uri} ]] || die "No store uri given"   [[ -n ${store} ]] || die "No store uri given"
92    
93   # only pna stores are allowed at the moment   # only pna stores are allowed at the moment
94   if [[ ${store_uri/config.xml} = ${store_uri} ]]   if [[ ${store/config.xml} = ${store} ]]
95   then   then
96   die "Only PNA Stores are allowed."   die "Only PNA Stores are allowed."
97   fi   fi
98    
99   store_name="$(normalize_store ${store_uri})"   store_name="$(normalize_store ${store})"
100   config="${STOREFRONT_STORES_DIR}/${store_name}.conf"   config="${STOREFRONT_STORES_DIR}/${store_name}.conf"
101   CONFIG="${MROOT}/${config}"   CONFIG="${MROOT}/${config}"
102   clearconfig   clearconfig
103   addconfig "STORE=\"${store_uri}\""   addconfig "STORE=\"${store}\""
104   ;;   ;;
105    
106   del)   del)
107   if [[ -z ${store_uri} ]]   if [[ -z ${store} ]]
108   then   then
109   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})   for config in $(NOCOLORS=1 list_files_in_directory ${STOREFRONT_STORES_DIR})
110   do   do
# Line 114  case "${method}" in Line 114  case "${method}" in
114   fi   fi
115   done   done
116   else   else
117   store_name="$(normalize_store ${store_uri})"   store_name="$(normalize_store ${store})"
118   if [ -f ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf ]   if [ -f ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf ]
119   then   then
120   rm ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf   rm ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf
# Line 125  case "${method}" in Line 125  case "${method}" in
125   ;;   ;;
126    
127   default)   default)
128   # requires store_uri   # requires store
129   [[ -n ${store_uri} ]] || die "No store uri given"   [[ -n ${store} ]] || die "No store uri given"
130    
131   store_name="$(normalize_store ${store_uri})"   store_name="$(normalize_store ${store})"
132   if [ -f ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf ]   if [ -f ${MROOT}/${STOREFRONT_STORES_DIR}/"${store_name}".conf ]
133   then   then
134   ln -snf ${STOREFRONT_STORES_DIR}/"${store_name}".conf ${STOREFRONT_DIR}/default-store   ln -snf ${STOREFRONT_STORES_DIR}/"${store_name}".conf ${STOREFRONT_DIR}/default-store
# Line 142  case "${method}" in Line 142  case "${method}" in
142   do   do
143   if [ -f ${STOREFRONT_STORES_DIR}/${config} ]   if [ -f ${STOREFRONT_STORES_DIR}/${config} ]
144   then   then
145   store_uri=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")   store=$(source ${STOREFRONT_STORES_DIR}/${config}; echo "${STORE}")
146   rvecho "${store_uri}"   rvecho "${store}"
147   fi   fi
148   done   done
149   ;;   ;;

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