I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to
- detect if the phone is connected to a USB port
- which port is used, and then
- access it.
I'm not connecting my phone via USB tethering. The code that I already have it's this:
tmp=`gio mount -l -i | grep activation_root`
mount_point=${tmp//activation_root=/}
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`
With this I'm getting the device and mounting it, but I've hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy for this situation.