Skip to content

Instantly share code, notes, and snippets.

@pulsejet
Created June 2, 2018 05:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pulsejet/263914cc5b7de4b3bdaeb490eb0cfa32 to your computer and use it in GitHub Desktop.
Save pulsejet/263914cc5b7de4b3bdaeb490eb0cfa32 to your computer and use it in GitHub Desktop.
Script to login to IITB Network
#!/bin/bash
if [[ -n $1 ]]
then
UNAME=$1
else
read -p 'Username: ' UNAME
[[ -z $UNAME ]] && exit 1
fi
if [[ -n $2 ]]
then
PASSWD=$2
else
read -sp 'Password: ' PASSWD
[[ -z $PASSWD ]] && exit 1
fi
wget --no-proxy --quiet --post-data="uname=$UNAME&passwd=$PASSWD&submit=button" \
https://internet.iitb.ac.in/index.php -O - | \
grep -q window.location.href && \
echo 'Logged in!' || \
echo "Something's wrong."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment