summaryrefslogtreecommitdiff
path: root/bin/clone-mirror
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-11-07 14:51:26 +0100
committerErich Eckner <git@eckner.net>2022-11-07 14:51:26 +0100
commit8db8728574483a52cddb8f53a52eac78be54ddd7 (patch)
tree167d6f2a8c38cf62e86019408758732e8d4cc568 /bin/clone-mirror
parent78924b80775515ab4c8dec7d9963deef17e9eecd (diff)
downloadairgapd-8db8728574483a52cddb8f53a52eac78be54ddd7.tar.xz
bin/clone-mirror: check for mountpoint
Diffstat (limited to 'bin/clone-mirror')
-rwxr-xr-xbin/clone-mirror14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/clone-mirror b/bin/clone-mirror
index cd5c035..cffdc15 100755
--- a/bin/clone-mirror
+++ b/bin/clone-mirror
@@ -3,8 +3,14 @@
work_dir=$(readlink -e "$0")
work_dir="${work_dir%/*/*}/work"
-mkdir -p "${work_dir}/archlinuxarm/"
+mkdir -p "${work_dir}/sticks/"
-rsync -rlptH --safe-links --delete-delay --delay-updates \
- 'rsync://de3.mirror.archlinuxarm.org/archlinux-arm/' \
- "${work_dir}/archlinuxarm/"
+for stick_dir in "${work_dir}/sticks/"*; do
+ [ -d "${stick_dir}" ] || continue
+ mountpoint -q "${stick_dir}" || continue
+ mkdir "${stick_dir}/archlinuxarm"
+ rsync -rlptH --safe-links --delete-delay --delay-updates \
+ --copy-dest="${work_dir}/sticks/"*"/archlinuxarm" \
+ 'rsync://de3.mirror.archlinuxarm.org/archlinux-arm/' \
+ "${stick_dir}/archlinuxarm"
+done