Advertisement
Guest User

Retrieving and returning current VPNBook.com password

a guest
May 18th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. # Define file to store the password temporarily
  2. TEMPFILE=/tmp/vpnbook_password.tmp
  3.  
  4. # Define connection timeout (in seconds)
  5. TIMEOUT=5
  6.  
  7. # Parse the website and save it to the temp file
  8. wget -q -T $TIMEOUT -O - "http://www.vpnbook.com/freevpn" | grep -m 1 "Password:" > $TEMPFILE
  9.  
  10. # Read the temp file, find the password and store it in the variable $PASSWORD
  11. PASSWORD=$( sed -n -e "s/.*<strong>\(.*\)<\/strong>.*/\1/p" $TEMPFILE )
  12.  
  13. # Return the current password
  14. echo $PASSWORD
  15.  
  16. # Delete temp file
  17. rm $TEMPFILE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement