diff options
| author | Christian Rößler | 2016-11-04 15:59:25 +0100 |
|---|---|---|
| committer | Christian Rößler | 2016-11-04 15:59:25 +0100 |
| commit | 13a665d7317615b472a66ce08fe6c0d126cdea39 (patch) | |
| tree | d5fd4b5f9879f97b5032fc99951d6d3aafc7e7df /remote/modules/pvs2/data/opt/openslx/scripts | |
| parent | [run-virt] resolution scripts now detect first connected output device (not o... (diff) | |
| parent | [rfs-stage32] Run update-issue after setup_partitions for proper /tmp display (diff) | |
| download | tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.gz tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.xz tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/pvs2/data/opt/openslx/scripts')
| -rwxr-xr-x | remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr | 28 | ||||
| -rwxr-xr-x | remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr | 22 |
2 files changed, 49 insertions, 1 deletions
diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr index 7a6c13d9..5531518a 100755 --- a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr +++ b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr @@ -1,4 +1,30 @@ #!/bin/ash +. /opt/openslx/config + +# Try to get fresh version from server +CONF= +if [ -n "$SLX_PVS_CONFIG_URL" ]; then + DST="$(mktemp)" + wget -T 5 -O "${DST}" "$SLX_PVS_CONFIG_URL" + [ -s "${DST}" ] && CONF="--config=${DST}" +fi + openbox & -exec /opt/openslx/bin/pvsmgr --manager-only + +timediff=5 +counter=0 + +while [ $timediff -gt 3 ]; do + start="$(date +%s)" + /opt/openslx/bin/pvsmgr "$CONF" "$@" + ret=$? + [ "$ret" == "0" ] && break + end="$(date +%s)" + timediff=$(( end - start )) + counter=$(( counter + 1 )) + [ $counter -gt 8 ] && break +done + +exit $ret + diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr new file mode 100755 index 00000000..1a56e8d0 --- /dev/null +++ b/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr @@ -0,0 +1,22 @@ +#!/bin/ash + +. /opt/openslx/config +DST="/opt/openslx/pvs2/pvs2.ini" + +# Try to get fresh version from server +if [ -n "$SLX_PVS_CONFIG_URL" ]; then + wget -T 10 -O "${DST}.new" "$SLX_PVS_CONFIG_URL" + [ -s "${DST}.new" ] && mv -f "${DST}.new" "${DST}" +fi + +# If this is a dedicated PVS station, make it launch right away +if [ -n "$SLX_PVS_DEDICATED" ] && cd /opt/openslx/xsessions; then + for file in *.desktop; do + cp -f "/usr/share/xsessions/pvs2mgr.desktop" "$file" + done + # patch autologin into kdmrc + sed -i '/AutoLogin.*=/d;/^\[X-.*-Core\]/a AutoLoginEnable=true\nAutoLoginUser=demo\nAutoLoginAgain=true\nAutoLoginDelay=0' "/etc/kde/kdm/kdmrc" +fi + +exit 0 + |
