#!/bin/sh # # CGI which process the request of the user _after_ he/she has pressed continue # # Rick van der Zwet # PATH=$PATH:/usr/local/bin:/usr/sbin:/usr/bin:/sbin DB=/tmp/authenticated.txt REMOTE_MAC=`arp -n $REMOTE_ADDR | awk '{print $4}'` # Delete entry from authorized list sudo pfctl -q -t wlportal -T delete $REMOTE_ADDR # Delete mac from authorized list grep -v $REMOTE_MAC $DB >> $DB.new mv $DB.new $DB # Redirect to proper page echo 'Content-Type: text/html' echo 'Cache-Control: no-cache, no-store, must-revalidate' echo 'Pragma: no-cache' echo 'Expires: 0' echo 'Refresh: 60; url=/portal/login' echo '' sed -e "s/\$REMOTE_ADDR/$REMOTE_ADDR/" \ -e "s/\$REMOTE_MAC/$REMOTE_MAC/" \ `dirname $0`/index.html.tmpl