1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

need capture-wsgi as template to soft code port

This commit is contained in:
George Hunt 2019-12-18 16:36:38 +00:00
parent c1744afa0c
commit 4e48d2baf2
2 changed files with 5 additions and 5 deletions

View file

@ -23,8 +23,8 @@
- { src: roles/captiveportal/templates/iiab-divert-to-nginx, mode: '0755', dest: /usr/sbin/ }
- name: Put put the python script that creates the server in place
copy:
src: roles/captiveportal/files/capture-wsgi.py
template:
src: roles/captiveportal/templates/capture-wsgi.py
mode: '0755'
dest: /opt/iiab/captiveportal/

View file

@ -51,8 +51,8 @@ logger = logging.getLogger('/var/log/apache2/portal.log')
handler = RotatingFileHandler("/var/log/apache2/portal.log", maxBytes=100000, backupCount=2)
logger.addHandler(handler)
#PORT={{ captiveportal_port }}
PORT=9090
PORT={{ captiveportal_port }}
#PORT=9090
# Define globals
@ -394,7 +394,7 @@ def application (environ, start_response):
data = ['{}: {}\n'.format(key, value) for key, value in sorted(environ.items()) ]
#logger.debug("need the correct ip:{}".format(data))
ip = environ['REMOTE_ADDR'].strip()
cmd="arp -an {}|gawk \'{{print $4}}\'".format(ip)
cmd="arp -an %s|gawk \'{print $4}\'"%(ip)
mac = subprocess.check_output(cmd, shell=True)
data = []
data.append("host: {}\n".format(environ['HTTP_HOST']))