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 2514 by niro, Mon Sep 14 10:29:34 2015 UTC revision 2520 by niro, Mon Sep 14 12:14:34 2015 UTC
# Line 4  " Line 4  "
4  source @@SYSCONFDIR@@/mcore/mcore.conf  source @@SYSCONFDIR@@/mcore/mcore.conf
5  source @@SYSCONFDIR@@/mcore/citrix.conf  source @@SYSCONFDIR@@/mcore/citrix.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
9    
10  : ${STOREFRONT_STORE=""}  : ${STOREFRONT_STORE=""}
# Line 18  then Line 18  then
18   export STOREFRONT_STORE="${DEFAULT_STOREFRONT_STORE}"   export STOREFRONT_STORE="${DEFAULT_STOREFRONT_STORE}"
19  fi  fi
20    
21  if ! storebrowse > /dev/null  if ! storebrowse &> /dev/null
22  then  then
23   if [ -d ~/.ICAClient ]   if [ -d ~/.ICAClient ]
24   then   then
25   rm -r ~/ICAClient   rm -r ~/.ICAClient
26   fi   fi
27    
28   install -d ~/.ICAClient   install -d ~/.ICAClient
29   touch ~/.ICAClient/.eula_accepted   touch ~/.ICAClient/.eula_accepted
30    
31   # kill running instances   # kill running instances
32   pidof AuthServiceDaemon > /dev/null && killall AuthServiceDaemon   pidof AuthManagerDaemon > /dev/null && killall AuthManagerDaemon
33   pidof ServiceRecord > /dev/null && killall ServiceRecord   pidof ServiceRecord > /dev/null && killall ServiceRecord
34   pidof storebrowse > /dev/null && killall storebrowse   pidof storebrowse > /dev/null && killall storebrowse
35    
# Line 43  then Line 43  then
43   echo "Store ${STOREFRONT_STORE} unknown, perhaps not added. Run 'rm -r ~/.ICAClient'."   echo "Store ${STOREFRONT_STORE} unknown, perhaps not added. Run 'rm -r ~/.ICAClient'."
44  else  else
45   OPT=""   OPT=""
46   [[ -n ${STOREFRONT_USER} ]] && OPT+=" -U \"${STOREFRONT_USER}\""   [[ -n ${STOREFRONT_USER} ]] && OPT+=" -U ${STOREFRONT_USER}"
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})
50   echo "${SESSION_LIST}"  
51     # exclude the desktop session, which is always the first
52     declare -i counter=0
53     echo "${SESSION_LIST}" | while read line
54     do
55     if [[ ${counter} -gt 0 ]]
56     then
57     session=$(echo ${line} | cut -d"'" -f 2)
58     description=$(echo ${line} | cut -d"'" -f 4)
59     echo "Session: '${session}' -> Description '${description}'"
60     fi
61     (( counter++ ))
62     done
63  fi  fi

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