diff options
Diffstat (limited to 'files/common/www/service')
| -rwxr-xr-x | files/common/www/service/cgi-bin/splash.html (renamed from files/common/www/service/cgi-bin/splash) | 2 | ||||
| -rwxr-xr-x | files/common/www/service/cgi-bin/splash_click.html (renamed from files/common/www/service/cgi-bin/splash_click) | 25 | 
2 files changed, 19 insertions, 8 deletions
diff --git a/files/common/www/service/cgi-bin/splash b/files/common/www/service/cgi-bin/splash.html index 1237ce0..b8c8264 100755 --- a/files/common/www/service/cgi-bin/splash +++ b/files/common/www/service/cgi-bin/splash.html @@ -4,4 +4,4 @@ echo -en "Content-Type: text/html\r\n"  echo -en "\r\n"  targeturl="$(echo "$QUERY_STRING" | tr -d '/')" -sed "s/targeturl/$targeturl/g" splash.html +sed "s/targeturl/$targeturl/g" index.html diff --git a/files/common/www/service/cgi-bin/splash_click b/files/common/www/service/cgi-bin/splash_click.html index 1eb4e85..59926d0 100755 --- a/files/common/www/service/cgi-bin/splash_click +++ b/files/common/www/service/cgi-bin/splash_click.html @@ -1,15 +1,15 @@  #!/bin/sh -e +  . $IPKG_INSTROOT/etc/functions.sh  . /etc/splash.sh - -echo -en "Status: 200 OK\r\n" -echo -en "Content-Type: text/html\r\n" -echo -en "\r\n" +. /www/service/cgi-bin/common.sh  # decode request params -URL="http://$(sed 's/target_url=//g' | urldecode)" +#URL="http://$(sed 's/target_url=//g' | urldecode || true)" +URL="http://sotun.de/"  USER_MAC=$(grep ^$REMOTE_HOST </proc/net/arp \  	 | awk 'BEGIN { FS = " " } ; { print $4 }') +[ -n "$USER_MAC" ]  # check if user is already splashed; splash otherwise  lockSplash @@ -25,7 +25,9 @@ config_foreach is_mac user  if [ $ISSPLASHED -eq 0 ]; then      # user is now free to go      chain=$chain_prefix$chain_id -    iptables -t nat -I $chain 1 -m mac --mac-source $USER_MAC -j ACCEPT +    if have_internet; then +	iptables -t nat -I $chain 1 -m mac --mac-source $USER_MAC -j ACCEPT +    fi      uci -q add splash_users user >/dev/null      uci -q set splash_users.@user[-1].mac=$USER_MAC @@ -34,4 +36,13 @@ fi  unlockSplash  # send response (encode / to not confuse sed) -sed "s/targeturl/$(echo "$URL" | sed 's#/#\\/#g')/g" iframe.html + +echo -en "Status: 200 OK\r +Content-Type: text/html\r +\r +" +if have_internet; then +    sed "s/targeturl/$(echo "$URL" | sed 's#/#\\/#g')/g" iframe.html +else +    cat internet.html +fi  | 
