-
-
Save sscarduzio/05ed0b41d6234530d724 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# CONF | |
DBG=true | |
[email protected] | |
RELOG_PASSW=xxxxxxxxxxxxxxx | |
# END CONF | |
IS_LOGGED_IN=$(wget "https://www.btopenzone.com:8443/home" --timeout 30 -O - 2>/dev/null | grep "accountLogoff") | |
if [ "$IS_LOGGED_IN" ] | |
then | |
[[ $DBG ]] && echo "currently logged in. Nothing to do.." | |
else | |
[[ $DBG ]] && echo "It's not logged in.. Will log in!" | |
OUT=$(wget -qO- --post-data "USERNAME=$RELOG_UNAME&PASSWORD=$RELOG_PASSW" "https://btwifi.portal.fon.com/remote?res=hsp-login&HSPNAME=FonBT%3AGB&WISPURL=https%3A%2F%2Fwww.btopenzone.com%3A8443%2FfonLogon&WISPURLHOME=https%3A%2F%2Fwww.btopenzone.com%3A8443&VNPNAME=FonBT%3AGB&LOCATIONNAME=FonBT%3AGB") | |
ONLINE=$(echo $OUT | grep youre_online ) | |
if [ "$ONLINE" ] | |
then | |
[[ $DBG ]] && echo "You're online!" | |
else | |
[[ $DBG ]] && echo "Could not login :(" | |
fi | |
fi |
@aidanmacgregor also now using your script (OpenWRT service). Nice work, thank you! Though I swapped the config over to /etc/btwifi.conf
since I'm not sure what owns rc.local
on OpenWRT.
@aidanmacgregor also now using your script (OpenWRT service). Nice work, thank you! Though I swapped the config over to
/etc/btwifi.conf
since I'm not sure what ownsrc.local
on OpenWRT.
Hey Awesome! Glad its Working Well For You, and i was under impression nothing touched it besides from the user :)
@shuckster With the SSID of BT WiFi hotspots now changing to "EE WiFi", will the cloud-connect plugin need to be altered, and if so, what is required?
@adammcguk - Thanks for the report.
If you're already using the plugin, you can try modifying this line in this file in your local filesystem.
Change it from:
BT_SSID=${CC_WIRELESS_SSID_MATCH:-"BTWi-fi\|BTWifi-with-FON"}
To:
BT_SSID=${CC_WIRELESS_SSID_MATCH:-"EE WiFi\|BTWi-fi\|BTWifi-with-FON"}
I have a suspicion the space may cause issues, so if the above doesn't work, try:
BT_SSID=${CC_WIRELESS_SSID_MATCH:-"EE\ WiFi\|BTWi-fi\|BTWifi-with-FON"}
If you are able try this and check that it works, I'll update the plugin in the repo so others can benefit.
@shuckster I tried the 2nd way and I also changed the main config file in the cloud connect plugin, as it also references the SSID. Not sure if this was required but after doing both, it is working.
ahh its set to loop so if first test passes waits 1 second and runs the same single packet ping again :)
EDIT: v4 Windows Exe Now Available
https://github.com/aidanmacgregor/BT_Wi-fi_Autologin_-_OpenWrt_Windows.EXE_Linux_Chrome-OS_Android-Macrodroid