From de6903b771d4fd71a13d4e74e2e77e0c18442a1d Mon Sep 17 00:00:00 2001 From: Bittersweet Date: Fri, 7 Sep 2018 11:39:35 +0800 Subject: [PATCH] Disable curl ssl check with option -k --- ipgw.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ipgw.sh b/ipgw.sh index a904cba..eca91f2 100755 --- a/ipgw.sh +++ b/ipgw.sh @@ -51,7 +51,7 @@ disconnect() LOGOUT=`wget -q --post-data="action=logout&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" -O - 2>&1` fi else - LOGOUT=`curl -s -d "action=logout&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` + LOGOUT=`curl -s -k -d "action=logout&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` fi if [[ "$LOGOUT" =~ "网络已断开" ]]; then @@ -72,7 +72,7 @@ connectasphone() LOGIN=`wget --header="Content-type: application/x-www-form-urlencoded" --header="User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4" -q --post-data="action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" -O - 2>&1` fi else - LOGIN=`curl -H "Content-type: application/x-www-form-urlencoded" -A "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4" -s -d "action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` + LOGIN=`curl -k -H "Content-type: application/x-www-form-urlencoded" -A "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4" -s -d "action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` fi if [[ "$LOGIN" =~ "网络已连接" ]]; then @@ -94,7 +94,7 @@ connect() LOGIN=`wget --header="Content-type: application/x-www-form-urlencoded" --header="User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" -q --post-data="action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" -O - 2>&1` fi else - LOGIN=`curl -H "Content-type: application/x-www-form-urlencoded" -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" -s -d "action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` + LOGIN=`curl -k -H "Content-type: application/x-www-form-urlencoded" -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" -s -d "action=login&ac_id=1&user_ip=&nas_ip=&user_mac=&url=&username=$USER_NAME&password=$USER_PASS&save_me=0" "https://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&" 2>&1` fi if [[ "$LOGIN" =~ "网络已连接" ]]; then @@ -115,7 +115,7 @@ query() INFO=`wget -q --post-data="action=get_online_info&key=$k" "https://ipgw.neu.edu.cn/include/auth_action.php?k=$k" -O - 2>&1` fi else - INFO=`curl -s -d "action=get_online_info&key=$k" "https://ipgw.neu.edu.cn/include/auth_action.php?k=$k" 2>&1` + INFO=`curl -k -s -d "action=get_online_info&key=$k" "https://ipgw.neu.edu.cn/include/auth_action.php?k=$k" 2>&1` fi #echo $k; #echo $INFO; @@ -235,4 +235,5 @@ fi #echo $LOGOUT #echo $LOGIN +sleep 2s