From 820d16d840f462bf1b614f487cef1ddb589084b4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 4 Aug 2016 16:01:53 +0200 Subject: [run-virt] Implement automatic firewalling --- .../data/opt/openslx/scripts/includes/setup_firewall.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_firewall.inc (limited to 'remote/modules/run-virt/data/opt/openslx/scripts/includes') 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 +} -- cgit v1.2.3-55-g7522