These scripts can be used for logging in and out of NITC Network from the CLI itself, without any need for GUI. It has been made sure that the script uses only bare-minimum external programs which is commonly available in any minimal Linux-based systems, so that it can be used in various headless systems such as Servers, Raspberry-pi..etc.
File | Description |
---|---|
login.sh |
This script will prompt the user for username and password, and will give appropriate status feedback for logging into the network. |
logout.sh |
This script is responsible for logging you out, it will logout from the network and give appropriate feedback for logout. It is highly recommended to use this script with the login script only. |
log_file |
This file will be generated by login.sh. This file stores the information about current session's key as well as the details of the network, this is used by the logout script. |
Dependencies: wget, curl, sed
Make sure you have the dependencies before using the script if not run sudo apt install wget curl sed
.
How to Use
Method 1 Without Installation:
The codes have to be run from its directory.
steps are :
- Go to the Directory containing the files
- Open terminal in the directory use command
./login.sh
. Enter your Username and password as promted. Firewall Authentication Successful is returned if login is succesfull. - To Logout ocpen terminal in the directory use command
./logout.sh
. Logout Successful is returned if logout is succesfull.
Method 2 By Installing:
The program is added into bashrc and can be used from terminal. As of now the install script supports bash and zsh shells.
Steps:
- Go to the Directory containing the files , Run
sudo ./install.sh
(The sudo previllege is mandatory). Returns Installation complete if successfull. The files are installed in /opt/nitc-auth-cli . - To logout Open terminal use command
nitc-logout
.To seelog_file
use commandnitc-logfile
.
Troubleshoot
If you are not able run the scripts, you can use the command
chmod +x <script-name>.sh
This will change the permission of the script files, and will allow you to run the scripts