Created
March 9, 2019 12:26
-
-
Save moinfar/fb70b08ac23fdd72737c599f70226433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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