summaryrefslogtreecommitdiffstats
path: root/remote/modules/safe-mode/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorJonathan Bauer2015-06-05 16:45:17 +0200
committerroot2015-06-05 16:45:17 +0200
commit83d9ebc9b7684a05325cd3e912d729883c4fb16a (patch)
tree4f19ed007aa599db50ffc3e2c76a82c907d01671 /remote/modules/safe-mode/data/opt/openslx/scripts
parent[pvs2] don't start pvsclient if we are running the pvsmgr session (diff)
downloadtm-scripts-83d9ebc9b7684a05325cd3e912d729883c4fb16a.tar.gz
tm-scripts-83d9ebc9b7684a05325cd3e912d729883c4fb16a.tar.xz
tm-scripts-83d9ebc9b7684a05325cd3e912d729883c4fb16a.zip
[safe-mode/firefox] e-klausur demo modules
Diffstat (limited to 'remote/modules/safe-mode/data/opt/openslx/scripts')
-rwxr-xr-xremote/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode59
1 files changed, 59 insertions, 0 deletions
diff --git a/remote/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode b/remote/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
new file mode 100755
index 00000000..6e66b35d
--- /dev/null
+++ b/remote/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
@@ -0,0 +1,59 @@
+#!/bin/ash
+
+disable_tty_switch() {
+ cat <<EOF > /etc/X11/xorg.conf.d/50-no-tty.conf
+Section "ServerFlags"
+ Option "DontVTSwitch" "true"
+EndSection
+EOF
+}
+
+disable_openbox_menu() {
+ [ ! -e "/etc/xdg/openbox/rc.xml.safe" ] && \
+ echo "No rc.xml.safe template found." && return 1
+ cp "/etc/xdg/openbox/rc.xml" "/root/rc.xml.unsafe"
+ cp "/etc/xdg/openbox/rc.xml.safe" "/etc/xdg/openbox/rc.xml"
+}
+
+disable_magic_keys() {
+ echo 0 > /proc/sys/kernel/sysrq
+}
+
+disable_cron_idleaction() {
+ rm /opt/openslx/scripts/idleaction-cron_script \
+ /opt/openslx/scripts/idleaction-scheduled_poweroff \
+ /opt/openslx/scripts/idleaction-scheduled_reboot
+}
+
+disable_systemd_auto_vt() {
+ sed -i 's/.*NAutoVTs=.*/NAutoVTs=0/g' "/etc/systemd/logind.conf"
+ systemctl restart systemd-logind
+}
+
+set_default_session() {
+ [ ! -e "/usr/share/xsessions/firefox.desktop" ] && \
+ echo "No firefox session found." && return 1
+ # we have it, copy it over default session
+ cp "/usr/share/xsessions/firefox.desktop" "/opt/openslx/xsessions/default.desktop"
+}
+
+no_autologin_delay() {
+ [ ! -e "/etc/kde4/kdm/kdmrc" ] && \
+ echo "Could not find '/etc/kde4/kdm/kdmrc'." && return 1
+ sed -i 's/^AutoLoginDelay=.*/AutoLoginDelay=0/g' "/etc/kde4/kdm/kdmrc"
+}
+
+
+. /opt/openslx/config
+
+[ -z "$SLX_BROWSER_START_URL" ] && \
+ echo "Not running in E-Klausur mode!" && \
+ exit 1
+
+disable_tty_switch
+disable_openbox_menu
+disable_magic_keys
+disable_cron_idleaction
+disable_systemd_auto_vt
+no_autologin_delay
+set_default_session