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 |
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 ]] |
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 |