summaryrefslogtreecommitdiffstats
path: root/remote/modules/pvs2
diff options
context:
space:
mode:
authorJonathan Bauer2016-01-22 17:34:47 +0100
committerJonathan Bauer2016-01-22 17:34:47 +0100
commitbec8d5eaf818737c73b3db8ba6713ce8cac87505 (patch)
tree6962e0c69cdee04fac82f86701ada137368c0615 /remote/modules/pvs2
parent[cups] added cupsd.conf to static data files (diff)
downloadtm-scripts-bec8d5eaf818737c73b3db8ba6713ce8cac87505.tar.gz
tm-scripts-bec8d5eaf818737c73b3db8ba6713ce8cac87505.tar.xz
tm-scripts-bec8d5eaf818737c73b3db8ba6713ce8cac87505.zip
[pvs] remove hardcoded name to pvs session. Instead check for the name in the xsession file
Diffstat (limited to 'remote/modules/pvs2')
-rwxr-xr-xremote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient16
1 files changed, 14 insertions, 2 deletions
diff --git a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
index f79b4997..c3e99a81 100755
--- a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
+++ b/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
@@ -1,7 +1,19 @@
#!/bin/ash
-# do not start pvsclient if we are running the pvs manager session
-[ "x${SESSION_NAME}" == "xPVS-Manager" ] && exit 0
+# detect name of the PVS-Manager session by looking at the xsession file
+# check old path...
+PVS_SESSION_NAME=
+PVS_XSESSION_FILE="pvs2mgr.desktop"
+for DIR in "/usr/share/xsessions" "/opt/openslx/xsessions/"; do
+ if [ -f "${DIR}/${PVS_XSESSION_FILE}" ]; then
+ PVS_SESSION_NAME="$(grep -E "^Name=.*$" "${DIR}/${PVS_XSESSION_FILE}" |cut -c 6-)"
+ break
+ fi
+done
+if [ -n "$PVS_SESSION_NAME" ]; then
+ # do not start pvsclient if we are running the pvs manager session
+ [ "x${SESSION_NAME}" == "x${PVS_SESSION_NAME}" ] && exit 0
+fi
# If the ENV var PVS has been set by vmchooser start pvsclient
if [ -n "$PVS_AUTO_CONNECT" -a "$PVS_AUTO_CONNECT" == "TRUE" ]; then
pvsclient --auto &