source: hybrid/branches/releng-10/nanobsd/files/usr/local/www/portal/logout/index.cgi@ 13056

Last change on this file since 13056 was 13056, checked in by rick, 11 years ago

Very simple and fast captive portal 'framework' using a few shell scripts replacing the slow python scripts

  • Property svn:executable set to *
File size: 542 bytes
Line 
1#!/bin/sh
2#
3# CGI which process the request of the user _after_ he/she has pressed continue
4#
5# Rick van der Zwet <info@rickvanderzwet.nl>
6#
7PATH=$PATH:/usr/sbin:/usr/bin:/sbin
8DB=/tmp/authenticated.txt
9
10REMOTE_MAC=`arp -n $REMOTE_ADDR | awk '{print $4}'`
11
12# Add entry to authorized list
13pfctl -q -t wlportal -T delete $REMOTE_ADDR
14
15# Redirect to proper page
16echo 'HTTP 1.0 200 OK'
17echo 'Refresh: 60; url=/portal/login'
18echo ''
19sed -e "s/\$REMOTE_ADDR/$REMOTE_ADDR/" \
20 -e "s/\$REMOTE_MAC/$REMOTE_MAC/" \
21 `dirname $0`/index.html.tmpl
Note: See TracBrowser for help on using the repository browser.