2 |
|
|
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 |
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 |
9 |
|
|
10 |
if [ ! -d ~/.ICAClient ] |
: ${STOREFRONT_STORE=""} |
11 |
then |
: ${STOREFRONT_USER=""} |
12 |
install -d ~/.ICAClient |
: ${STOREFRONT_PASS=""} |
13 |
fi |
: ${STOREFRONT_DOMAIN=""} |
14 |
|
|
15 |
if [ ! -f ~/.ICAClient ] |
# get default store |
16 |
|
if [[ -z ${STOREFRONT_STORE} ]] |
17 |
then |
then |
18 |
touch ~/.ICAClient/.eula_accepted |
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/.tmp ] |
if [ -d ~/.ICAClient ] |
24 |
then |
then |
25 |
rm -r ~/ICAClient/.tmp |
rm -r ~/ICAClient |
26 |
fi |
fi |
27 |
|
|
28 |
|
install -d ~/.ICAClient |
29 |
|
touch ~/.ICAClient/.eula_accepted |
30 |
|
|
31 |
# kill running instances |
# kill running instances |
32 |
pidof AuthServiceDaemon > /dev/null && killall AuthServiceDaemon |
pidof AuthServiceDaemon > /dev/null && killall AuthServiceDaemon |
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 |
|
|
36 |
# register eula |
# register eula and add default store |
37 |
xvfb-run -a -s "-extension RANDR" storebrowse |
xvfb-run -a -s "-extension RANDR" storebrowse -a "${STOREFRONT_STORE}" |
38 |
fi |
fi |
39 |
|
|
40 |
# get all sessions of default store |
# get all sessions |
41 |
export STOREFRONT_STORE="${DEFAULT_STOREFRONT_STORE}" |
if [[ -z $(storebrowse -l | grep -i ${STOREFRONT_STORE}) ]] |
42 |
${MCORE_LIBDIR}/storefront-resolver |
then |
43 |
|
echo "Store ${STOREFRONT_STORE} unknown, perhaps not added. Run 'rm -r ~/.ICAClient'." |
44 |
|
else |
45 |
|
OPT="" |
46 |
|
[[ -n ${STOREFRONT_USER} ]] && OPT+=" -U \"${STOREFRONT_USER}\"" |
47 |
|
[[ -n ${STOREFRONT_PASS} ]] && OPT+=" -P \"${STOREFRONT_PASS}\"" |
48 |
|
[[ -n ${STOREFRONT_DOMAIN} ]] && OPT+=" -D \"${STOREFRONT_DOMAIN}\"" |
49 |
|
SESSION_LIST="$(storebrowse -E ${OPT} ${STOREFRONT_STORE})" |
50 |
|
echo "${SESSION_LIST}" |
51 |
|
fi |