From 0e0d4051c4a4fc7d019ee0848d79d0244ea1df26 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 30 Dec 2022 11:15:57 +0100 Subject: [PATCH] Fixing deploy-incoming --- deploy-incoming | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy-incoming b/deploy-incoming index 8568ad5..b3b7795 100755 --- a/deploy-incoming +++ b/deploy-incoming @@ -6,6 +6,8 @@ REPO_ROOT="/var/www/html" INCOMING_ROOT="/var/www/incoming" REPO_USER=repo REPO_GROUP=users +REPO_USER_HOME="/home/repo" +UPDATE_REPOS_SCRIPT="${REPO_USER_HOME}/bin/update-repos" declare -A MAPPINGS=() @@ -34,27 +36,33 @@ for src_dir_part in "${!MAPPINGS[@]}" ; do for file in ${src_dir}/* ; do if [[ -f "${file}" ]] ; then # echo " * ${file}" + file_base=$( basename "${file}" ) tgt="${tgt_dir}" if [[ "${src_dir_part}" =~ ^el && "${file}" =~ src\.rpm$ ]] ; then tgt="${src_tgt_dir}" fi + tgt_file="${tgt}/${file_base}" if [[ ! -d "${tgt}" ]] ; then printf " * " mkdir -p -v "${tgt}/" fi printf " * " mv -v "${file}" "${tgt}/" + printf " " + chown -v ${REPO_USER}:${REPO_GROUP} "${tgt_file}" fi done - echo - echo "Chowning '${src_dir}' to ${REPO_USER}:${REPO_GROUP} ..." - chown -R ${REPO_USER}:${REPO_GROUP} "${src_dir}" - fi done +if [[ -x "${UPDATE_REPOS_SCRIPT}" ]] ; then + echo + echo "Updating Debian repos ..." + su --login "${REPO_USER}" --command "${UPDATE_REPOS_SCRIPT}" +fi + for repo_dir in "${REPO_ROOT}"/Yum/* ; do bname=$( basename "${repo_dir}" ) @@ -76,5 +84,4 @@ for repo_dir in "${REPO_ROOT}"/Yum/* ; do done - # vim: ts=4 et sw=4 -- 2.39.5