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 2821 by niro, Fri Jul 28 09:55:58 2017 UTC revision 2822 by niro, Fri Jul 28 09:58:24 2017 UTC
# Line 68  else Line 68  else
68   exit 1   exit 1
69   fi   fi
70    
  # exclude the desktop session, which is always the first  
  declare -i counter=0  
71   while read line   while read line
72   do   do
73   if [[ ${counter} -gt 0 ]]   session=$(echo ${line} | cut -d"'" -f 2)
74   then   description=$(echo ${line} | cut -d"'" -f 4)
75   session=$(echo ${line} | cut -d"'" -f 2)   decho "Session: '${session}' -> Description '${description}'"
  description=$(echo ${line} | cut -d"'" -f 4)  
  decho "Session: '${session}' -> Description '${description}'"  
   
  # import or update db entry  
  id=$(mysqldo "select id from values_storefront_session where session='${session}';")  
  if [[ -z ${id} ]]  
  then  
  mysqldo "insert into values_storefront_session (session,description,store,enabled) values('${session}','${description}','${STOREFRONT_STORE}','1');"  
  else  
  mysqldo "update values_storefront_session set session='${session}',description='${description}',store='${STOREFRONT_STORE}',enabled='1' where id='${id}';"  
  fi  
76    
77   # get and save id   # import or update db entry
78   id=$(mysqldo "select id from values_storefront_session where session='${session}';")   id=$(mysqldo "select id from values_storefront_session where session='${session}';")
79   export IMPORTED_IDS+=" ${id}"   if [[ -z ${id} ]]
80     then
81     mysqldo "insert into values_storefront_session (session,description,store,enabled) values('${session}','${description}','${STOREFRONT_STORE}','1');"
82     else
83     mysqldo "update values_storefront_session set session='${session}',description='${description}',store='${STOREFRONT_STORE}',enabled='1' where id='${id}';"
84   fi   fi
85   (( counter++ ))  
86     # get and save id
87     id=$(mysqldo "select id from values_storefront_session where session='${session}';")
88     export IMPORTED_IDS+=" ${id}"
89   done << EOF   done << EOF
90  $(echo "${SESSION_LIST}")  $(echo "${SESSION_LIST}")
91  EOF  EOF

Legend:
Removed from v.2821  
changed lines
  Added in v.2822