|
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 | #
|
|---|
| 7 | PATH=$PATH:/usr/sbin:/usr/bin:/sbin
|
|---|
| 8 | DB=/tmp/authenticated.txt
|
|---|
| 9 |
|
|---|
| 10 | REMOTE_MAC=`arp -n $REMOTE_ADDR | awk '{print $4}'`
|
|---|
| 11 |
|
|---|
| 12 | # Add entry to authorized list
|
|---|
| 13 | pfctl -q -t wlportal -T delete $REMOTE_ADDR
|
|---|
| 14 |
|
|---|
| 15 | # Redirect to proper page
|
|---|
| 16 | echo 'HTTP 1.0 200 OK'
|
|---|
| 17 | echo 'Refresh: 60; url=/portal/login'
|
|---|
| 18 | echo ''
|
|---|
| 19 | sed -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.