From 47612c60f3436b5bdff26fbc8d869a0f1eca7ed2 Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Sun, 18 Aug 2013 20:41:30 +0000 Subject: applications/luci-splash: Per default redirect to the page the user requested after he accepted the splash. This can be overwritten with redirect_url in the general section in luci_splash config, #595 --- applications/luci-splash/htdocs/cgi-bin/splash/splash.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'applications/luci-splash/htdocs') diff --git a/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh b/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh index cbffaf6ab..76f6d4d3e 100755 --- a/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh +++ b/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh @@ -1,4 +1,15 @@ #!/bin/sh + +$(uci -q get luci_splash.general.redirect_url) || { + set -x + touch /var/state/luci_splash_locations + touch /etc/config/luci_splash_locations + MAC=$(grep "$REMOTE_HOST" /proc/net/arp | awk '{print $4}') + uci -P /var/state set luci_splash_locations.${MAC//:/}=redirect + uci -P /var/state set luci_splash_locations.${MAC//:/}.location="http://${HTTP_HOST}${REQUEST_URI}" + set +x +} + echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" echo -en "Pragma: no-cache\r\n" echo -en "Expires: -1\r\n" @@ -21,3 +32,4 @@ cat < EOT + -- cgit v1.2.3