You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Thaiwifi
|
|
|
|
|
|
|
|
Automatically logs into a captive portal
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
### Python script
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo apt install python3 python3-pip python-virtualenv python3-virtualenv
|
|
|
|
$ sudo python3 -m pip install --upgrade setuptools
|
|
|
|
$ git clone https://gogs.tannercollin.com/tanner/thaiwifi.git
|
|
|
|
$ cd thaiwifi
|
|
|
|
$ virtualenv -p python3 env
|
|
|
|
$ . env/bin/activate
|
|
|
|
$ pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
### Supervisor
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo apt install supervisor
|
|
|
|
$ sudo touch /etc/supervisor/conf.d/thaiwifi.conf
|
|
|
|
$ sudoedit /etc/supervisor/conf.d/thaiwifi.conf
|
|
|
|
$ sudo supervisorctl reread
|
|
|
|
$ sudo supervisorctl update
|
|
|
|
```
|
|
|
|
|
|
|
|
Add:
|
|
|
|
```
|
|
|
|
[program:thaiwifi]
|
|
|
|
user=pi
|
|
|
|
directory=/home/tanner/devel/thaiwifi
|
|
|
|
command=/bin/bash -c 'source env/bin/activate && python thaiwifi.py'
|
|
|
|
autostart=true
|
|
|
|
autorestart=true
|
|
|
|
stderr_logfile=/var/log/thaiwifi.log
|
|
|
|
stderr_logfile_maxbytes=1MB
|
|
|
|
stdout_logfile=/var/log/thaiwifi.log
|
|
|
|
stdout_logfile_maxbytes=1MB
|
|
|
|
```
|