#!/bin/bash source @@SYSCONFDIR@@/mcore/citrix.conf ICA="$1" die() { echo "ERROR: $@"; exit 1; } [[ -n ${ICA} ]] || die "No ICA given" [[ -f ${ICA} ]] || die "No ICA does not exist" if [[ -z ${ICAROOT} ]] then export ICAROOT="${SYSTEM_ICAROOT}" fi # create required citrix runtime with an accepted eula install -d ~/.ICAClient touch ~/.ICAClient/.eula_accepted # don't allow to run more than one instance of an ICA session at the same time if [[ -z $(ps aux | grep "wf[iI]ca ${ICA}") ]] then wfica "${ICA}" || die "Could not launch '${ICA}'" else echo "Session '${ICA}' already runnning." exit 3 fi