Contents of /alx-src/branches/alxconf-060/bin/storefront-resolver.sh
Parent Directory | Revision Log
Revision 6758 -
(show annotations)
(download)
(as text)
Fri Jul 17 07:38:20 2015 UTC (8 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1193 byte(s)
Fri Jul 17 07:38:20 2015 UTC (8 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1193 byte(s)
-use xmessage to tell the user whats going on
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 | source /etc/alxconfig-ng/storefront.rc |
13 | |
14 | # prefer storebrowse |
15 | if [[ -e ${ICAROOT}/util/storebrowse ]] |
16 | then |
17 | BROWSER=${ICAROOT}/util/storebrowse |
18 | |
19 | # use old pnabrowse |
20 | elif [[ -e ${ICAROOT}/util/pnabrowse ]] |
21 | then |
22 | BROWSER=${ICAROOT}/util/pnabrowse |
23 | else |
24 | echo "No Citrix browser found." |
25 | exit 1 |
26 | fi |
27 | |
28 | USE_XMESSAGE=0 |
29 | if [[ -x $(type -P xmessage) ]] |
30 | then |
31 | USE_XMESSAGE=1 |
32 | fi |
33 | |
34 | case ${CMD} in |
35 | enumerate) |
36 | # enumerate apps |
37 | "${BROWSER}" -E -U "${USER}" -P "${PASS}" -D "${DOMAIN}" "${STORE}" |
38 | ;; |
39 | |
40 | launch) |
41 | # launch apps |
42 | if [[ ${USE_XMESSAGE} = 1 ]] |
43 | then |
44 | xmessage -center -title "ICA-Client" -buttons "" " |
45 | Starting session '${APP}' ... |
46 | |
47 | " & |
48 | fi |
49 | if "${BROWSER}" -L "${APP}" -U "${USER}" -P "${PASS}" -D "${DOMAIN}" "${STORE}" |
50 | then |
51 | if [[ ${USE_XMESSAGE} = 1 ]] |
52 | then |
53 | killall xmessage |
54 | fi |
55 | else |
56 | if [[ ${USE_XMESSAGE} = 1 ]] |
57 | then |
58 | killall xmessage |
59 | xmessage -center -title "ICA-Client" -buttons " |
60 | Abort" "Failed to start session '${APP}'. |
61 | |
62 | " & |
63 | else |
64 | echo "Failed to start session '${APP}'." |
65 | fi |
66 | fi |
67 | ;; |
68 | |
69 | *) |
70 | echo "Unknown command '${CMD}'." |
71 | exit 1 |
72 | ;; |
73 | esac |