Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/citrix/storefront-session.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2354 by niro, Mon Aug 24 12:27:10 2015 UTC revision 2388 by niro, Wed Aug 26 12:19:43 2015 UTC
# Line 5  /mcore/mcore.conf Line 5  /mcore/mcore.conf
5  source ${MCORE_LIBDIR}/include/common.global.class  source ${MCORE_LIBDIR}/include/common.global.class
6  source ${MCORE_LIBDIR}/include/daemon.global.class  source ${MCORE_LIBDIR}/include/daemon.global.class
7    
8  STROREFRONTDIR="${MCORE_CONFIG_PATH}/citrix/storefront"  STOREFRONTDIR="${MCORE_CONFIG_PATH}/citrix/storefront"
9    
10  die() { echo "ERROR: $@"; exit 1; }  die() { echo "ERROR: $@"; exit 1; }
11    
# Line 29  case "${method}" in Line 29  case "${method}" in
29   add)   add)
30   # requires name   # requires name
31   [[ -n ${name} ]] || die "No name given"   [[ -n ${name} ]] || die "No name given"
  # action 'add' requires mode too  
  [[ -n ${mode} ]] || die "No mode given"  
32   # and session   # and session
33   [[ -n ${session} ]] || die "No session given"   [[ -n ${session} ]] || die "No session given"
34    
# Line 39  case "${method}" in Line 37  case "${method}" in
37   clearconfig   clearconfig
38    
39   addconfig '#!/bin/bash'   addconfig '#!/bin/bash'
40   addconfig "${MCORE_LIBDIR}/storefront-resolver launch '${session}' '${user}' '${password}' '${domain}'"   addconfig "${MCORE_LIBDIR}/storefront-resolver launch '${user}' '${password}' '${domain}' '${session}'"
41     chmod +x "${storefront_starter}"
42    
43   if is_provided fluxbox   if is_provided fluxbox
44   then   then
# Line 47  case "${method}" in Line 46  case "${method}" in
46   ${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "${storefront_starter}" &&   ${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "${storefront_starter}" &&
47   ${MCORE_LIBDIR}/fluxbox-rebuild-menu   ${MCORE_LIBDIR}/fluxbox-rebuild-menu
48   fi   fi
49     if is_provided idesk
50     then
51     # generate idesk desktop icon
52     ${MCORE_LIBDIR}/idesk-generate-icon-info --add --name "${name}" --command "${storefront_starter}" --icon default.png &&
53     ${MCORE_LIBDIR}/idesk-generate-all-desktop-icons
54     fi
55   ;;   ;;
56    
57   del)   del)
# Line 59  case "${method}" in Line 64  case "${method}" in
64   ${MCORE_LIBDIR}/fluxbox-menuitem --del  --name "${name}" &&   ${MCORE_LIBDIR}/fluxbox-menuitem --del  --name "${name}" &&
65   ${MCORE_LIBDIR}/fluxbox-rebuild-menu   ${MCORE_LIBDIR}/fluxbox-rebuild-menu
66   fi   fi
67     if is_provided idesk
68     then
69     ${MCORE_LIBDIR}/idesk-generate-icon-info --del --name "${name}" &&
70     ${MCORE_LIBDIR}/idesk-generate-all-desktop-icons
71     fi
72   else   else
73   eecho "No configured session named '${name}' exists."   eecho "No configured session named '${name}' exists."
74   fi   fi
# Line 69  case "${method}" in Line 79  case "${method}" in
79   ;;   ;;
80    
81   query)   query)
82   eval sessionlist=( $(${MCORE_LIBDIR}/storefront-resolver enumerate) )   eval sessionlist=( $(su - "${MCORE_UNPRIV_USER}" -c "${MCORE_LIBDIR}/storefront-resolver enumerate '${user}' '${password}' '${domain}'") )
83   sessioncount="${#sessionlist[*]}"   sessioncount="${#sessionlist[*]}"
84   for (( i=0; i<sessioncount; i++))   for (( i=0; i<sessioncount; i++))
85   do   do

Legend:
Removed from v.2354  
changed lines
  Added in v.2388