summaryrefslogtreecommitdiffstats
path: root/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient')
-rwxr-xr-xcore/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient36
1 files changed, 20 insertions, 16 deletions
diff --git a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
index 5ff03227..cd932597 100755
--- a/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
+++ b/core/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
@@ -2,20 +2,24 @@
# SESSION_TYPE can be either 'VSESSION' or 'XSESSION'
-# detect session command of the PVS-Manager session by looking at the xsession file
-PVSMGR_SESSION_CMD=
-PVSMGR_XSESSION_FILE="pvs2mgr.desktop"
-# the second directory should not be needed, but lets be compatible with the old crap......
-for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do
- if [ -f "${DIR}/${PVSMGR_XSESSION_FILE}" ]; then
- # extract the exact command string
- PVSMGR_SESSION_CMD="$(grep -E "^Exec=.*$" "${DIR}/${PVSMGR_XSESSION_FILE}" |cut -c 6-)"
- break
+if [ "$SESSION_TYPE" = "XSESSION" ]; then
+ # detect session command of the PVS-Manager session by looking at the xsession file
+ # TODO Maybe the vmchooser should just expose the session file's name/path, or we
+ # can define a new X-Property in the .desktop file that stops pvsclient from starting.
+ PVSMGR_SESSION_CMD=
+ PVSMGR_XSESSION_FILE="pvs2mgr.desktop"
+ # the second directory should not be needed, but lets be compatible with the old crap......
+ for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do
+ if [ -f "${DIR}/${PVSMGR_XSESSION_FILE}" ]; then
+ # extract the exact command string
+ PVSMGR_SESSION_CMD="$(grep -E "^Exec=.*$" "${DIR}/${PVSMGR_XSESSION_FILE}" |cut -c 6-)"
+ break
+ fi
+ done
+ if [ -n "${PVSMGR_SESSION_CMD}" ]; then
+ # do not start pvsclient if we are running the pvs manager session
+ [ "x${SESSION_CMD}" == "x${PVSMGR_SESSION_CMD}" ] && exit 0
fi
-done
-if [ -n "${PVSMGR_SESSION_CMD}" ]; then
- # do not start pvsclient if we are running the pvs manager session
- [ "x${SESSION_CMD}" == "x${PVSMGR_SESSION_CMD}" ] && exit 0
fi
# Download fresh copy of config file if possible
@@ -38,16 +42,16 @@ fi
# If the ENV var PVS has been set by vmchooser start pvsclient
if [ "$PVS_AUTO_CONNECT" == "TRUE" ]; then
- pvsstartup "$PVSCONFIG" --auto &
+ pvsstartup $PVSCONFIG --auto &
else
- pvsstartup "$PVSCONFIG" &
+ pvsstartup $PVSCONFIG &
fi
# Finally, handle hybrid mode where the pvsmgr is launched on the second desktop
# alongside the actual vm. (make sure this is a VSESSION!)
if [ "$SESSION_TYPE" == "VSESSION" ]; then
{
- wt="PVS2-Manager"
+ wt="PVS2 Manager"
pvsmgr "$PVSCONFIG" --manager-only &
for i in 100 100 200 200 200 300 500 500 1000; do
usleep $(( i * 1000 )) || sleep 1