summaryrefslogtreecommitdiffstats
path: root/core/modules/kiosk-slxbrowser
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-14 21:46:32 +0100
committerSimon Rettberg2019-03-14 21:46:32 +0100
commit69ec0eaf618690c04c06104740f3e5ed8704b48d (patch)
tree5d85476a3b3d18074d85461a32fe103d097cb602 /core/modules/kiosk-slxbrowser
parent[rootfs-stage31/dhcpc-busybox] Back to old DHCP behavior (diff)
downloadmltk-69ec0eaf618690c04c06104740f3e5ed8704b48d.tar.gz
mltk-69ec0eaf618690c04c06104740f3e5ed8704b48d.tar.xz
mltk-69ec0eaf618690c04c06104740f3e5ed8704b48d.zip
[kiosk-slxbrowser] Honor new black/whitelist vars
Diffstat (limited to 'core/modules/kiosk-slxbrowser')
-rw-r--r--core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser25
1 files changed, 21 insertions, 4 deletions
diff --git a/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser b/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser
index 5a9196c4..26fd6459 100644
--- a/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser
+++ b/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser
@@ -3,8 +3,25 @@
export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin
-[ -n "$SLX_BROWSER_INSECURE" ] && SLX_BROWSER_INSECURE="--insecure"
-RELOAD=
-[ -n "$SLX_BROWSER_RELOAD_SECS" ] && [ "$SLX_BROWSER_RELOAD_SECS" -gt 0 ] && RELOAD="--reload-interval $SLX_BROWSER_RELOAD_SECS"
+OPTS=
-exec slxbrowser $SLX_BROWSER_INSECURE $RELOAD --fullscreen "$SLX_BROWSER_URL"
+# Ignore SSL errors
+[ -n "$SLX_BROWSER_INSECURE" ] && [ "$SLX_BROWSER_INSECURE" -gt 0 ] && OPTS="$OPTS --insecure"
+# On inactivity, reload every X seconds
+[ -n "$SLX_BROWSER_RELOAD_SECS" ] && [ "$SLX_BROWSER_RELOAD_SECS" -gt 0 ] && OPTS="$OPTS --reload-interval $SLX_BROWSER_RELOAD_SECS"
+# If set, is a space separated list of URLs or hosts
+if [ -n "$SLX_BROWSER_URLLIST" ]; then
+ # Turn into file with one entry per line
+ LIST=$(mktemp)
+ echo "$SLX_BROWSER_URLLIST" | sed -r 's/\s+/\n/g' > "$LIST"
+ # Is it a whitelist or blacklist
+ if [ -n "$SLX_BROWSER_IS_WHITELIST" ] && [ "$SLX_BROWSER_IS_WHITELIST" -gt 0 ]; then
+ OPTS="$OPTS --whitelist $LIST"
+ else
+ OPTS="$OPTS --blacklist $LIST"
+ fi
+ # Async, clean up file after slxbrowser read it
+ ( sleep 5; rm -f -- "$LIST" ) &
+fi
+
+exec slxbrowser $OPTS --fullscreen "$SLX_BROWSER_URL"