Use temporary directories for mounting #102

Open
matthijskooijman wants to merge 3 commits from matthijskooijman/temp-mount-dir into master

3 Commits

Author SHA1 Message Date
Matthijs Kooijman
36382051a3 Use a random temp directory for mounting
This allows using the script multiple times in parallel on different
disks.

To prevent all these directories littering the filesystem, an exit
handler is registered to remove them again when the script exits (also
unmounting any mounted filesystems just in case).
2020-07-14 16:45:03 +02:00
Matthijs Kooijman
5294c9b911 Create mount directories earlier
The `$clone` directory is already used when figuring out disk space for
unmounted partitions, so this could fail on the first run.
2020-07-14 16:40:22 +02:00
Matthijs Kooijman
f4319096d3 Do not hardcode /mnt/clone in rpi-clone-setup
Instead, pass the mount location through an environment variable.
2020-07-14 16:40:22 +02:00