Skip to content

A simple script and service to automatically login to KIET's wifi on startup

Notifications You must be signed in to change notification settings

VanshSahay/kietwifi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

KIETWIFI

A bash script that automates the process of logging into KIET's college and hostel wifi. It securely stores credentials and can be configured to run automatically at system startup.

Features

  • One-time credential setup and secure storage
  • Automatic login on system startup
  • Proper error handling and exit codes

Prerequisites

  • bash shell
  • curl
  • wget
  • systemd (optional, for service installation)

Installation

  1. Download the script:
sudo wget -O /usr/local/bin/wifi_login.sh https://raw.githubusercontent.com/VanshSahay/kietwifi/main/wifi_login.sh
  1. Make the script executable:
sudo chmod +x /usr/local/bin/wifi_login.sh

Configuration

On first run, the script will prompt for:

  • Username
  • Password

These credentials are stored securely in ~/.wifi_credentials with restricted permissions (600).

Usage

Manual Execution

/usr/local/bin/wifi_login.sh

Automatic Startup

  1. Create a systemd service file:
sudo nano /etc/systemd/system/wifi-login.service
  1. Add the following content:
[Unit]
Description=Automatic WiFi Login Service
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/wifi_login.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
  1. Enable and start the service:
sudo systemctl enable wifi-login.service
sudo systemctl start wifi-login.service

Logs

Login attempts are logged to /var/log/wifi_login.log with timestamps.

To view logs:

tail -f /var/log/wifi_login.log

Troubleshooting

  1. Login Failures

    • Check if credentials are correct
    • Verify network connectivity
    • Review logs in /var/log/wifi_login.log
  2. Script Not Running at Startup

    • Check systemd service status:
      sudo systemctl status wifi-login.service
  3. Credential Reset

    • Delete the credentials file and run the script again:
      rm ~/.wifi_credentials
      /usr/local/bin/wifi_login.sh

Contributing

Feel free to submit issues and enhancement requests!

About

A simple script and service to automatically login to KIET's wifi on startup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages