From 9395d678f8493b7d052ab6afbceb04e39a4bb921 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20R=2E=20Sede=C3=B1o?= Date: Fri, 26 Apr 2024 11:54:29 -0400 Subject: [PATCH] fedora-buffet: exit early if bind mounts appear to be missing --- fetch-scripts/fedora-buffet | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fetch-scripts/fedora-buffet b/fetch-scripts/fedora-buffet index abbae8b..0080141 100644 --- a/fetch-scripts/fedora-buffet +++ b/fetch-scripts/fedora-buffet @@ -27,6 +27,19 @@ if ! [ -x "${QFM}" ]; then exit 1 fi +# Early ownership checks for bind-mounted target directories. +exit_early= +for dir in epel fedora; do + check_target="${MIRRORDIR}/fedora-buffet/${dir}" + if ! [ -O "${check_target}" ]; then + echo "${check_target} ownership is wrong; is the bind mount missing?" + exit_early=yes + fi +done +if [ -n "${exit_early}" ]; then + exit 1 +fi + exittrap() { :; } trap 'exittrap' EXIT -- 2.45.2