Skip to content

Using OpenWRT to automatically approve LDAP login everyday at 9pm (or on router restart).

Notifications You must be signed in to change notification settings

AviShahCode/netaccess-approver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

IITM Netaccess Auto Login Script

A simple shell script to automatically log in and approve sessions on the IIT Madras Netaccess portal.
Ideal for users who want uninterrupted network access without manually logging in every day.


🚀 Features

  • Automatically logs in to netaccess.iitm.ac.in
  • Approves sessions for 1 hour or 1 day
  • Maintains session cookies for stability
  • Logs all activity to a specified log file
  • Supports automation via crontab or /etc/rc.local

⚙️ Configuration

Edit the script and update the configuration section at the top:

# --- Config ---
USER="roll_no"           # Your Roll Number / Username
PASS="password"          # Your Netaccess password
IP="x.x.x.x"             # Your device’s IP address
ROOM="optional"          # Room number (optional)
DURATION="2"             # 1 = 1 hour, 2 = 1 day
COOKIE_JAR="/root/netaccess_cookies.txt"
LOG="/tmp/netaccess.log"

Tip: If you get an error saying could not find IP of netaccess, add this entry to your /etc/hosts file: {ip} netaccess.iitm.ac.in You can find the {ip} by running: ping netaccess.iitm.ac.in

🖥️ Usage

Manual Run

sudo sh /root/netaccess.sh

Automate with Crontab

Run every day at 9 PM:

crontab -e

and add:

0 21 * * * /root/netaccess.sh >/dev/null 2>&1

Run on Boot (Recommended)

Since @reboot is not enabled on OpenWRT, use /etc/rc.local:

sleep 10
sh /root/netaccess.sh >/dev/null 2>&1

📜 Log File

All logs are stored at:

/tmp/netaccess.log

You can check it anytime using:

cat /tmp/netaccess.log

Requires curl to be installed:

opkg update
opkg install curl

About

Using OpenWRT to automatically approve LDAP login everyday at 9pm (or on router restart).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages