From 861dbda6bc4a12995b7b3f5ef02d64786d90fc53 Mon Sep 17 00:00:00 2001 From: Zeno Zeng Date: Tue, 23 Sep 2014 16:31:12 +0800 Subject: [PATCH] update wlan's logout, fixes #20 --- wlan.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wlan.sh b/wlan.sh index 1154d43..c510f2c 100755 --- a/wlan.sh +++ b/wlan.sh @@ -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;