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

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