Skip to content

Instantly share code, notes, and snippets.

@moinfar
Created March 9, 2019 12:26
Show Gist options
  • Save moinfar/fb70b08ac23fdd72737c599f70226433 to your computer and use it in GitHub Desktop.
Save moinfar/fb70b08ac23fdd72737c599f70226433 to your computer and use it in GitHub Desktop.
read -p "Enter Sharif ID: " username
stty -echo
read -p "Enter password: " password
stty echo
echo "\nPlease wait" ...
if [ -z "$username" ]
then
# empty username
curl -d "" -X POST https://net2.sharif.edu/logout 2>/dev/null | sed -z -e 's/<[^>]*>//g' | tr -s ' ' | sed '/^\s*$/d'
else
curl -d "username=$username&password=$password" -X POST https://net2.sharif.edu/login 2>/dev/null | sed -z -e 's/<[^>]*>//g' | tr -s ' ' | sed '/^\s*$/d'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment