10 |
|
|
11 |
die() { echo "ERROR: $@"; exit 1; } |
die() { echo "ERROR: $@"; exit 1; } |
12 |
|
|
13 |
|
load_classes client |
14 |
|
|
15 |
# very basic getops |
# very basic getops |
16 |
for argv in $* |
for argv in $* |
17 |
do |
do |
23 |
--user) shift; user="$1" ;; |
--user) shift; user="$1" ;; |
24 |
--domain) shift; domain="$1" ;; |
--domain) shift; domain="$1" ;; |
25 |
--password) shift; password="$1" ;; |
--password) shift; password="$1" ;; |
26 |
|
--serverlist) shift; serverlist="$1" ;; |
27 |
|
--autostart) shift; autostart="$1" ;; |
28 |
esac |
esac |
29 |
shift |
shift |
30 |
done |
done |
31 |
|
|
32 |
[[ -n ${method} ]] || die "No method given" |
[[ -n ${method} ]] || die "No method given" |
33 |
|
[[ -n ${autostart} ]] || autostart=0 |
34 |
|
|
35 |
case "${method}" in |
case "${method}" in |
36 |
add) |
add) |
49 |
*) die "unknown mode '${mode}'" |
*) die "unknown mode '${mode}'" |
50 |
esac |
esac |
51 |
|
|
52 |
|
# add servers from serverlist |
53 |
|
if [[ -n ${serverlist} ]] |
54 |
|
then |
55 |
|
OLD_IFS=$IFS |
56 |
|
IFS=";" |
57 |
|
for server in ${serverlist} |
58 |
|
do |
59 |
|
${MCORE_LIBDIR}/citrix-serverlist --add --server "${server}" |
60 |
|
done |
61 |
|
IFS=${OLD_IFS} |
62 |
|
fi |
63 |
|
|
64 |
icafile="${ICADIR}/${name}.${ICASUFFIX}" |
icafile="${ICADIR}/${name}.${ICASUFFIX}" |
65 |
CONFIG="${MROOT}/${icafile}" |
CONFIG="${MROOT}/${icafile}" |
66 |
clearconfig |
clearconfig |
76 |
server_num="${i}" |
server_num="${i}" |
77 |
[[ ${i} -eq 1 ]] && server_num="" |
[[ ${i} -eq 1 ]] && server_num="" |
78 |
addconfig "TcpBrowserAddress${server_num}=${server}" |
addconfig "TcpBrowserAddress${server_num}=${server}" |
79 |
|
addconfig "HttpBrowserAddress${server_num}=${server}" |
80 |
done |
done |
81 |
addconfig 'ScreenPercent=0' |
addconfig 'ScreenPercent=0' |
82 |
addconfig '[ApplicationServers]' |
addconfig '[ApplicationServers]' |
123 |
if is_provided fluxbox |
if is_provided fluxbox |
124 |
then |
then |
125 |
# generate fluxbox menu entry |
# generate fluxbox menu entry |
126 |
${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "wfica ${icafile}" && |
${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "${MCORE_LIBDIR}/launch-ica ${icafile}" && |
127 |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
128 |
|
# add autostart |
129 |
|
if [[ ${autostart} = 1 ]] |
130 |
|
then |
131 |
|
${MCORE_LIBDIR}/fluxbox-autostart --add --name "${name}" --exec "${MCORE_LIBDIR}/launch-ica ${icafile}" && |
132 |
|
${MCORE_LIBDIR}/fluxbox-rebuild-autostart |
133 |
|
fi |
134 |
fi |
fi |
135 |
if is_provided idesk |
if is_provided idesk |
136 |
then |
then |
137 |
# generate idesk desktop icon |
# generate idesk desktop icon |
138 |
${MCORE_LIBDIR}/idesk-generate-icon-info --add --name "${name}" --command "wfica ${icafile}" --icon default.png && |
${MCORE_LIBDIR}/idesk-generate-icon-info --add --name "${name}" --command "${MCORE_LIBDIR}/launch-ica ${icafile}" --icon default.png && |
139 |
${MCORE_LIBDIR}/idesk-generate-all-desktop-icons |
${MCORE_LIBDIR}/idesk-generate-all-desktop-icons |
140 |
fi |
fi |
141 |
;; |
;; |
149 |
then |
then |
150 |
${MCORE_LIBDIR}/fluxbox-menuitem --del --name "${name}" && |
${MCORE_LIBDIR}/fluxbox-menuitem --del --name "${name}" && |
151 |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
152 |
|
${MCORE_LIBDIR}/fluxbox-autostart --del --name "${name}" && |
153 |
|
${MCORE_LIBDIR}/fluxbox-rebuild-autostart |
154 |
fi |
fi |
155 |
if is_provided idesk |
if is_provided idesk |
156 |
then |
then |