From 8db8728574483a52cddb8f53a52eac78be54ddd7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 7 Nov 2022 14:51:26 +0100 Subject: bin/clone-mirror: check for mountpoint --- bin/clone-mirror | 14 ++++++++++---- 1 file 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 -- cgit v1.2.3-70-g09d2