Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2015
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.11 KB | None | 0 0
  1. #!/bin/bash
  2. # Script that copies WhatsApp images from Android smartphones
  3. # Author NoWebAtHome <nowebathome@protonmail.com>
  4. # Version 0.1
  5.  
  6. # Making sure destiny directory exists...
  7. mkdir ~/Dropbox/".:)"
  8.  
  9. phone=$(ls /run/user/0/gvfs/)
  10. until [ "$phone" != "" ]
  11. do
  12.     # Here is where the Android is mounted in my system.
  13.     phone=$(ls /run/user/0/gvfs/)
  14.     #echo "No phone detected."
  15.     sleep 3
  16. done
  17.  
  18.  
  19. # make sure it is unlocked
  20. unlocked=$(ls /run/user/0/gvfs/$phone/)
  21. until [ "$unlocked" != "" ]
  22. do
  23.     unlocked=$(ls /run/user/0/gvfs/$phone/)
  24.     #echo "Phone detected, but it's locked."
  25.     sleep 3
  26. done
  27.  
  28. #echo "Phone unlocked!"
  29. # The gvfs-copy works just like cp, but can't recursively copy directories.
  30. # For this reason is necessary to call it twice, for 'Images' and 'Sent' directories.
  31.  
  32. # Saves at ~/Dropbox/".:)"/ (Starting with a dot, the directory becomes hidden)
  33. gvfs-copy /run/user/0/gvfs/$phone/Phone/WhatsApp/Media/WhatsApp\ Images/* ~/Dropbox/".:)"/ 2> /dev/null
  34. gvfs-copy /run/user/0/gvfs/$phone/Phone/WhatsApp/Media/WhatsApp\ Images/Sent/* ~/Dropbox/".:)"/ 2> /dev/null
  35.  
  36. echo "Check your destiny folder."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement