This tutorial is assume you're using latest LTS Ubuntu and using IAC3 as the main URI to login. You can change the script manually to use your main PENS IAC Network URI captive portal.
Prepare your email and password, and make sure your account is active by manually login into PENS CAS portal. In this tutorial I will use this account below as an example
Email : irfan@it.student.pens.ac.id
Password : irfan123
Download file login.sh and change
AUTH_USER="yourpensemail@it.student.pens.ac.id"
AUTH_PASS="yourpassword"
into your own account
AUTH_USER="irfan@it.student.pens.ac.id"
AUTH_PASS="irfan123"
(IMPORTANT) Change to your main IAC URI. Some PENS network have different IAC URI depends on how you connect to PENS network. For example:
IAC_URI="https://iac2.pens.ac.id:8003/index.php?zone=eepiswlan"
Save login.sh in your home directory ~/.pens/login.sh then add execution permission into login.sh file
For example if you want to use command one by one
mkdir -p ~/.pens/login.sh
mv login.sh ~/.pens/login.sh
chmod +x ~/.pens/login.sh
- Logout your current session account by accessing this link or your main IAC URI. and click button
Disconnect. Or you can send "/clear_iac" message to PENS Bot Telegram - Run your script in your terminal
bash ~/.pens/login.sh, it should print textInternet not accessible. Logging into CAS portals... - Check your internet connection, and make sure it's works
Run sudo systemctl status cron.service and make sure the result is active and enabled
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-09-20 12:27:35 UTC; 6 days ago
Docs: man:cron(8)
Main PID: 3868188 (cron)
Tasks: 1 (limit: 2220)
Memory: 7.2M
CPU: 57.421s
CGroup: /system.slice/cron.service
└─3868188 /usr/sbin/cron -f -P
if not, run sudo systemctl enable --now cron.service
Run crontab -e (if there is an interactive choice, just choose anything you want). The cron will execute the script every 15 minutes. Add this line in the bottom of text
*/15 * * * * /bin/bash /home/<your username>/.pens/login.shIf you're confuse what <your username> is, just run whoami
Thanks for your information.