diff --git a/bitsnet b/bitsnet index 0a39d9e..ee3cec0 100755 --- a/bitsnet +++ b/bitsnet @@ -28,6 +28,10 @@ while getopts "u:p:dhUof" o; do f) f=1 ;; + + w) + cisco=1 + ;; h | * | [?]) show_help ;; @@ -66,11 +70,17 @@ if [[ "$f" == "0" && "$dev" == "0" ]]; then fi +# Log into Cisco Hostel Wifi router if dev = 2 +if [[ "$dev" == "2" && "$(hostname -I)" != "10.20"* ]]; then + cisco=1 +fi + + # Login debug_msg "" debug_msg "Logging in" # If dev is wifi and IP is not library IP -if [[ "$dev" == "2" && "$(hostname -I)" != "10.20"* ]]; then +if [[ $cisco == "1" ]]; then # Log into the router debug_msg "Connected to wifi. Sending request to cisco router form" router_login diff --git a/util.sh b/util.sh index 19ff784..3fbb3c9 100644 --- a/util.sh +++ b/util.sh @@ -65,7 +65,7 @@ function update { } function log_out { - reply=$(wget -qO- --no-check-certificate --post-data="mode=193&username=$username&submit=Logout" $login_url) + reply=$(wget -qO- --no-check-certificate --post-data="mode=193&username=garbage" $login_url) reply=$(extract_msg $reply) send_msg "$reply" exit