summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/scripts/includes
diff options
context:
space:
mode:
authorSimon Rettberg2016-08-04 16:01:53 +0200
committerSimon Rettberg2016-08-04 16:01:53 +0200
commit820d16d840f462bf1b614f487cef1ddb589084b4 (patch)
treef59a936c2f185412de136d81faaf5538e525dcd1 /remote/modules/run-virt/data/opt/openslx/scripts/includes
parent[kernel-vanilla] -> 4.4.16 (diff)
downloadtm-scripts-820d16d840f462bf1b614f487cef1ddb589084b4.tar.gz
tm-scripts-820d16d840f462bf1b614f487cef1ddb589084b4.tar.xz
tm-scripts-820d16d840f462bf1b614f487cef1ddb589084b4.zip
[run-virt] Implement automatic firewalling
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts/includes')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_firewall.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_firewall.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_firewall.inc
new file mode 100644
index 00000000..f0820ed7
--- /dev/null
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_firewall.inc
@@ -0,0 +1,12 @@
+
+setup_firewall () {
+ local LOGF="${TMPDIR}/firewall.log"
+ local RET
+ [ "$DISPLAY" = ":0" ] || return 0 # For now, to avoid conflicts, we only do this on display :0
+ slxfwtool "$IMGUUID" > "$LOGF" 2>&1
+ RET=$?
+ if [ "$RET" != "0" ]; then
+ slxlog "runvirt-firewall" "Error setting up firewall rules for lecture $IMGUUID (Exit code $RET)" "$LOGF"
+ fi
+ return 0
+}