Python code that utilizes the mechanize library for netaccess approval of the IIT Madras network from command line. This script is aimed at Linux systems.
- To run code, use command
netaccess
- To avoid having to input username and password every time the code is executed, enter them directly in the code located at
/usr/bin/netaccess.py
in the fields "YourUsername" and "YourPassword" in line number 7 and 8. Retain the double quotes. - Leaving the password field unchanged lets you input it during runtime securely.
An AUTOINSTALL script is available in this repository that automatically installs all necessary programs with minimal user intervention. Copy the script AUTOINSTALL and run it using sudo priveleges by invoking the command
sudo bash AUTOINSTALL
Further, the code may be run when desired by using the command
netaccess
To avoid entering username and password everytime on execution, refer the section on Usage above. All instructions provided below are automatically executed by the script AUTOINSTALL.
An INSTALL script is also available for users who would like to install after performing a git clone as described below.
To get a copy of the project up and running on your local machine for development and testing purposes run
git clone "git://github.com/cibinjoseph/IITM-Netaccess-Approval.git"
Ensure the following programs/libraries are installed on your system. If not, use the corresponding commands provided to install them (For Ubuntu OS)
- git
sudo apt install git
- python
sudo apt install python
- pip
sudo apt install python-pip
- mechanize library for Python
pip2 install mechanize
After installation, change the mode of the code to 'executable' by issuing the command
sudo chmod +x netaccess.py
Move the code to /usr/bin for universal access. The code may then be run by issuing
netaccess
Cibin Joseph, Aerospace Engineering, IIT Madras
This project is licensed under the MIT License - see the LICENSE.md file for details