Advertisement
Guest User

BT open zone automatic

a guest
Dec 17th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # CONF
  4.  
  5. DBG=true
  6. RELOG_UNAME="usernamehere"
  7. RELOG_PASSW="passwordhere"
  8.  
  9. # END CONF
  10.  
  11. 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")
  12.  
  13. if [ "$IS_LOGGED_IN" ]
  14.  
  15. then
  16. $DBG && echo "Currently logged in. Nothing to do... :)"
  17. $DBG && logger -t "logon_fon" "Currently logged in. Nothing to do... :)"
  18.  
  19. else
  20. $DBG && echo "You're not logged in... will log in now!"
  21. $DBG && logger -t "logon_fon" "You're not logged in... will log in now!"
  22. OUT=$(wget -qO - --no-check-certificate --no-cache --post-data "username=$RELOG_UNAME&password=$RELOG_PASSW" "https://www.btopenzone.com:8443/ante")
  23. ONLINE=$(echo $OUT | grep "now logged on" )
  24. if [ "$ONLINE" ]
  25. then
  26. $DBG && echo "You're online!"
  27. $DBG && logger -t "logon_fon" "You're online!"
  28. else
  29. $DBG && echo "Could not login :("
  30. $DBG && logger -t "logon_fon" "Could not login :("
  31. fi
  32. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement