#!/bin/sh -e . $IPKG_INSTROOT/etc/functions.sh . /etc/splash.sh . /www/service/cgi-bin/common.sh # decode request params #URL="http://$(sed 's/target_url=//g' | urldecode || true)" URL="http://sotun.de/" USER_MAC=$(grep ^$REMOTE_HOST /dev/null uci -q set splash_users.@user[-1].mac=$USER_MAC uci -q set splash_users.@user[-1].time=`date +%s` fi unlockSplash # send response (encode / to not confuse sed) 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