From 786df0669f73375d4bf5703c422e910839b7717f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 10 Oct 2016 19:37:42 +0200 Subject: [pvs2] Use command line option for config file location; use new client side exam mode config --- remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr | 9 +++++++++ remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'remote/modules/pvs2/data/opt/openslx/scripts') diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr index f39e03aa..be44e87e 100755 --- a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr +++ b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr @@ -1,5 +1,14 @@ #!/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 5 -O "${DST}.new" "$SLX_PVS_CONFIG_URL" + [ -s "${DST}.new" ] && mv -f "${DST}.new" "${DST}" +fi + openbox & exec /opt/openslx/bin/pvsmgr "$@" diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr index 34ae61d5..1a56e8d0 100755 --- a/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr +++ b/remote/modules/pvs2/data/opt/openslx/scripts/systemd-pvsmgr @@ -5,18 +5,10 @@ DST="/opt/openslx/pvs2/pvs2.ini" # Try to get fresh version from server if [ -n "$SLX_PVS_CONFIG_URL" ]; then - wget -O "${DST}.new" "$SLX_PVS_CONFIG_URL" + wget -T 10 -O "${DST}.new" "$SLX_PVS_CONFIG_URL" [ -s "${DST}.new" ] && mv -f "${DST}.new" "${DST}" fi -# Patch exam mode according to what our fetched config says -if [ -n "$SLX_EXAM" ]; then - EMODE=True -else - EMODE=False -fi -sed -i "/^examMode/d;/^\\[General\\]/a examMode=$EMODE" "$DST" - # 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 -- cgit v1.2.3-55-g7522