项目作者: karlicoss

项目描述 :
Make BT Wifi great again
高级语言: Python
项目地址: git://github.com/karlicoss/bt-wifi-reconnect.git
创建时间: 2017-04-06T21:02:46Z
项目社区:https://github.com/karlicoss/bt-wifi-reconnect

开源协议:

下载


BT Wifi logs me out for no apparent reason several times a day.. so I wrote a cron script to reconnect me every few minutes!

If it detects a lack of internet connectivity, it runs a virtual browser (phantom JS) and logs you in.

Setup

Recursive clone is important since I am using submodule!

  1. git clone --recursive git@github.com:karlicoss/bt-wifi-reconnect.git

Running

  1. cp config.py.example config.py
  2. vim config.py # type in path to phantomjs, and your credentials
  3. python3 check_and_reconnect.py

Adding to cron

  1. crontab -e
  2. add an entry like this */2 * * * * /usr/bin/python3 /full/path/to/script/bt_check_and_reconnect.py, this runs the script every two minutes

Easy peasy!

Prerequisites

  • pip3 install -r requirements.txt
  • phantomjs (see config.py.example for more details)