openmamba-headserver-tools/bin/openmamba-repository-fix-permissions

25 lines
739 B
Bash
Executable File

#!/bin/bash
#
# Fixes permissions on repositories
# Copyright (c) 2009-2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /usr/share/makedist/functions.inc.sh
. /etc/sysconfig/openmamba-central
for rep in ${local_reps[*]}; do
getent passwd ftp$rep >/dev/null || {
echo "Warning: missing user ftp$rep for $rep repository; skipping."
continue
}
find /var/ftp/pub/openmamba/$rep/SRPMS.base \
-user ftp$rep -a -group users -o -exec chown ftp$rep:users {} \;
for a in ${archs[*]}; do
[ -e /var/ftp/pub/openmamba/$rep/RPMS.$a ] && \
find /var/ftp/pub/openmamba/$rep/RPMS.$a \
-user ftp$rep -a -group users -o -exec chown ftp$rep:users {} \;
done
# >/dev/null
done
exit 0