Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Add option to force hostel-wifi (cisco) login
- Fix an issue with logout
  • Loading branch information
utkarshme authored Mar 8, 2017
2 parents da70068 + 65c101b commit 842c366
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion bitsnet
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ while getopts "u:p:dhUof" o; do
f)
f=1
;;

w)
cisco=1
;;
h | * | [?])
show_help
;;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 842c366

Please sign in to comment.