Advertisement
Guest User

register.sh

a guest
Mar 11th, 2017
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. #!/bin/bash
  2. #pm u/starbuck93 with questions or help
  3. #requirements: megatools
  4. #              a directory /home/username/megarc/
  5. #              a megarc template as follows: (put your base email and the word TEST will be replaced by a number to distinguish accounts and put the same password close to CONFIRM as it doesn't matter that much.)
  6.  
  7.  
  8. #$ touch megarc/storageTest
  9. #[Login]
  10. #Username = myEmail+storageTEST@gmail.com
  11. #Password = p@ssw0rd
  12.  
  13.  
  14. #script begins:
  15.  
  16. if [ $# -ne 1 ]; then
  17.     echo "$0": usage: ./register.sh 20
  18.     exit 1
  19. fi
  20.  
  21. #fill in your email and password on the next command
  22.  
  23. CONFIRM="$(megareg --scripted --register --email youremail+storage"$1"@gmail.com --name random --password p@ssw0rd)"
  24.  
  25. cp ~/megarc/storageTest ~/megarc/storage"$1"
  26. sed -i 's/TEST/'"$1"'/g' ~/megarc/storage"$1"
  27. echo "Paste the link from the email here and hit ENTER:"
  28. read link
  29. link2=${link/mega.nz/mega.co.nz}
  30. link3=${CONFIRM/@LINK@/\'"$link2"\'}
  31. @eval $link3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement