Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Feb 2017, 03:14
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
BtWifi-with-FON web auto connect/login script
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 1885
Location: In The Way

PostPosted: Fri 16 Sep 2016, 00:25    Post subject:  BtWifi-with-FON web auto connect/login script
Subject description: this script works
 

Here is a script that works when connecting to BTwifi-with-FON hotspots. Usually this needs to be done with a browser, now that stage is automated.

Code:
#!/bin/sh

# CONF

DBG=false
RELOG_UNAME="username"
RELOG_PASSW="password"

# END CONF

IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --no-check-certificate --no-cache --timeout 30 -O - 2>/dev/null | grep "now logged in")

if [ "$IS_LOGGED_IN" ]

then
  [[ $DBG ]] && echo "Currently logged in. Nothing to do... :)"
  [[ $DBG ]] && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"

else
  [[ $DBG ]] && echo "You're not logged in... will log in now!"
  [[ $DBG ]] && logger -t "logon_fon" "You're not logged in... will log in now!"
  OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW&provider=tbb" "https://www.btopenzone.com:8443/tbbLogon")
  ONLINE=$(echo $OUT | grep "now logged on" )
  if [ "$ONLINE" ]
  then
    [[ $DBG ]] && echo "You're online!"
    [[ $DBG ]] && logger -t "logon_fon" "You're online!"
  else
    [[ $DBG ]] && echo "Could not login :("
    [[ $DBG ]] && logger -t "logon_fon" "Could not login :("
  fi
fi
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0260s ][ Queries: 11 (0.0053s) ][ GZIP on ]