21 |
--user) shift; user="$1" ;; |
--user) shift; user="$1" ;; |
22 |
--domain) shift; domain="$1" ;; |
--domain) shift; domain="$1" ;; |
23 |
--password) shift; password="$1" ;; |
--password) shift; password="$1" ;; |
24 |
|
--serverlist) shift; serverlist="$1" ;; |
25 |
|
--autostart) shift; autostart="$1" ;; |
26 |
esac |
esac |
27 |
shift |
shift |
28 |
done |
done |
29 |
|
|
30 |
[[ -n ${method} ]] || die "No method given" |
[[ -n ${method} ]] || die "No method given" |
31 |
|
[[ -n ${autostart} ]] || autostart=0 |
32 |
|
|
33 |
case "${method}" in |
case "${method}" in |
34 |
add) |
add) |
47 |
*) die "unknown mode '${mode}'" |
*) die "unknown mode '${mode}'" |
48 |
esac |
esac |
49 |
|
|
50 |
|
# add servers from serverlist |
51 |
|
if [[ -n ${serverlist} ]] |
52 |
|
then |
53 |
|
OLD_IFS=$IFS |
54 |
|
IFS=";" |
55 |
|
for server in ${serverlist} |
56 |
|
do |
57 |
|
${MCORE_LIBDIR}/citrix-serverlist --add --server "${server}" |
58 |
|
done |
59 |
|
IFS=${OLD_IFS} |
60 |
|
fi |
61 |
|
|
62 |
icafile="${ICADIR}/${name}.${ICASUFFIX}" |
icafile="${ICADIR}/${name}.${ICASUFFIX}" |
63 |
CONFIG="${MROOT}/${icafile}" |
CONFIG="${MROOT}/${icafile}" |
64 |
clearconfig |
clearconfig |
74 |
server_num="${i}" |
server_num="${i}" |
75 |
[[ ${i} -eq 1 ]] && server_num="" |
[[ ${i} -eq 1 ]] && server_num="" |
76 |
addconfig "TcpBrowserAddress${server_num}=${server}" |
addconfig "TcpBrowserAddress${server_num}=${server}" |
77 |
|
addconfig "HttpBrowserAddress${server_num}=${server}" |
78 |
done |
done |
79 |
addconfig 'ScreenPercent=0' |
addconfig 'ScreenPercent=0' |
80 |
addconfig '[ApplicationServers]' |
addconfig '[ApplicationServers]' |
121 |
if is_provided fluxbox |
if is_provided fluxbox |
122 |
then |
then |
123 |
# generate fluxbox menu entry |
# generate fluxbox menu entry |
124 |
${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "wfica ${icafile}" && |
${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "${MCORE_LIBDIR}/launch-ica ${icafile}" && |
125 |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
126 |
|
# add autostart |
127 |
|
if [[ ${autostart} = 1 ]] |
128 |
|
then |
129 |
|
${MCORE_LIBDIR}/fluxbox-autostart --add --name "${name}" --exec "${MCORE_LIBDIR}/launch-ica ${icafile}" && |
130 |
|
${MCORE_LIBDIR}/fluxbox-rebuild-autostart |
131 |
|
fi |
132 |
fi |
fi |
133 |
if is_provided idesk |
if is_provided idesk |
134 |
then |
then |
135 |
# generate idesk desktop icon |
# generate idesk desktop icon |
136 |
${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 && |
137 |
${MCORE_LIBDIR}/idesk-generate-all-desktop-icons |
${MCORE_LIBDIR}/idesk-generate-all-desktop-icons |
138 |
fi |
fi |
139 |
;; |
;; |
147 |
then |
then |
148 |
${MCORE_LIBDIR}/fluxbox-menuitem --del --name "${name}" && |
${MCORE_LIBDIR}/fluxbox-menuitem --del --name "${name}" && |
149 |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
${MCORE_LIBDIR}/fluxbox-rebuild-menu |
150 |
|
${MCORE_LIBDIR}/fluxbox-autostart --del --name "${name}" && |
151 |
|
${MCORE_LIBDIR}/fluxbox-rebuild-autostart |
152 |
fi |
fi |
153 |
if is_provided idesk |
if is_provided idesk |
154 |
then |
then |