Magellan Linux

Contents of /alx-src/branches/alxconf-060/bin/storefront-resolver.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6764 - (show annotations) (download) (as text)
Tue Jul 21 12:17:14 2015 UTC (8 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1228 byte(s)
-honor environment
1 #!/bin/bash
2
3 CMD="$1"
4 USER="$2"
5 PASS="$3"
6 DOMAIN="$4"
7 APP="$5"
8
9 BROWSER=""
10 : ${STORE=""}
11
12 if [[ -z ${STORE} ]]
13 then
14 source /etc/alxconfig-ng/storefront.rc
15 fi
16
17 # prefer storebrowse
18 if [[ -e ${ICAROOT}/util/storebrowse ]]
19 then
20 BROWSER=${ICAROOT}/util/storebrowse
21
22 # use old pnabrowse
23 elif [[ -e ${ICAROOT}/util/pnabrowse ]]
24 then
25 BROWSER=${ICAROOT}/util/pnabrowse
26 else
27 echo "No Citrix browser found."
28 exit 1
29 fi
30
31 USE_XMESSAGE=0
32 if [[ -x $(type -P xmessage) ]]
33 then
34 USE_XMESSAGE=1
35 fi
36
37 case ${CMD} in
38 enumerate)
39 # enumerate apps
40 "${BROWSER}" -E -U "${USER}" -P "${PASS}" -D "${DOMAIN}" "${STORE}"
41 ;;
42
43 launch)
44 # launch apps
45 if [[ ${USE_XMESSAGE} = 1 ]]
46 then
47 xmessage -center -title "ICA-Client" -buttons "" "
48 Starting session '${APP}' ...
49
50 " &
51 fi
52 if "${BROWSER}" -L "${APP}" -U "${USER}" -P "${PASS}" -D "${DOMAIN}" "${STORE}"
53 then
54 if [[ ${USE_XMESSAGE} = 1 ]]
55 then
56 killall xmessage
57 fi
58 else
59 if [[ ${USE_XMESSAGE} = 1 ]]
60 then
61 killall xmessage
62 xmessage -center -title "ICA-Client" -buttons "
63 Abort" "Failed to start session '${APP}'.
64
65 " &
66 else
67 echo "Failed to start session '${APP}'."
68 fi
69 fi
70 ;;
71
72 *)
73 echo "Unknown command '${CMD}'."
74 exit 1
75 ;;
76 esac