1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 11:44:48 +08:00

update wlan's logout, fixes #20

This commit is contained in:
Zeno Zeng 2014-09-23 16:31:12 +08:00
parent 7e51715f8f
commit 861dbda6bc

View File

@ -26,12 +26,15 @@ logout() {
PASSWORD=$2
echo "Logout: ${USERNAME}"
RESPONSE=$(curl "https://net.zju.edu.cn/rad_online.php" -H "Content-Type: application/x-www-form-urlencoded" -d "action=auto_dm&username=${USERNAME}&password=${PASSWORD}" -s | iconv -c -f gbk -t utf8)
RESPONSE=$(curl "https://net.zju.edu.cn/cgi-bin/srun_portal" -H "Content-Type: application/x-www-form-urlencoded" -d "action=logout" -s)
case "${RESPONSE}" in
*ok*)
echo "Logout: success."
;;
*成功*)
echo "Logout: success."
;;
*)
echo "Logout: ${RESPONSE}"
exit 1;