Magellan Linux

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

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

revision 2519 by niro, Mon Sep 14 12:12:48 2015 UTC revision 2520 by niro, Mon Sep 14 12:14:34 2015 UTC
# Line 3  Line 3 
3  MCORE_LIBDIR="@@MCORE_LIBDIR@@"  MCORE_LIBDIR="@@MCORE_LIBDIR@@"
4  source @@SYSCONFDIR@@/mcore/mcore.conf  source @@SYSCONFDIR@@/mcore/mcore.conf
5  source @@SYSCONFDIR@@/mcore/citrix.conf  source @@SYSCONFDIR@@/mcore/citrix.conf
 source @@SYSCONFDIR@@/mcore/control.conf  
6  source ${MCORE_LIBDIR}/include/common.global.class  source ${MCORE_LIBDIR}/include/common.global.class
7  source ${MCORE_LIBDIR}/include/daemon.global.class  source ${MCORE_LIBDIR}/include/daemon.global.class
8  source ${MCORE_LIBDIR}/include/mysqlfunctions.global.class  source ${MCORE_LIBDIR}/include/mysqlfunctions.global.class
# Line 48  else Line 47  else
47   [[ -n ${STOREFRONT_PASS} ]] && OPT+=" -P ${STOREFRONT_PASS}"   [[ -n ${STOREFRONT_PASS} ]] && OPT+=" -P ${STOREFRONT_PASS}"
48   [[ -n ${STOREFRONT_DOMAIN} ]] && OPT+=" -D ${STOREFRONT_DOMAIN}"   [[ -n ${STOREFRONT_DOMAIN} ]] && OPT+=" -D ${STOREFRONT_DOMAIN}"
49   SESSION_LIST=$(storebrowse -E ${OPT} ${STOREFRONT_STORE})   SESSION_LIST=$(storebrowse -E ${OPT} ${STOREFRONT_STORE})
  if [[ $? != 0 ]]  
  then  
  echo "could not retrieve session list"  
  exit 1  
  fi  
50    
51   # exclude the desktop session, which is always the first   # exclude the desktop session, which is always the first
52   declare -i counter=0   declare -i counter=0
  IMPORTED_IDS=""  
53   echo "${SESSION_LIST}" | while read line   echo "${SESSION_LIST}" | while read line
54   do   do
55   if [[ ${counter} -gt 0 ]]   if [[ ${counter} -gt 0 ]]
# Line 64  else Line 57  else
57   session=$(echo ${line} | cut -d"'" -f 2)   session=$(echo ${line} | cut -d"'" -f 2)
58   description=$(echo ${line} | cut -d"'" -f 4)   description=$(echo ${line} | cut -d"'" -f 4)
59   echo "Session: '${session}' -> Description '${description}'"   echo "Session: '${session}' -> Description '${description}'"
   
  # import or update db entry  
  mysqldo "insert into values_storefront_session (session,description,enabled) values('${session}','${description}','1') on duplicate key update session='${session}',description='${description}',enabled='1';"  
   
  # get and save id  
  id=$(mysqldo "select id from values_storefront_session where session='${session}';")  
  IMPORTED_IDS+=" ${id}"  
60   fi   fi
61   (( counter++ ))   (( counter++ ))
62   done   done
   
  # now disable all other ids in the database  
   
63  fi  fi

Legend:
Removed from v.2519  
changed lines
  Added in v.2520