#!/bin/bash if [ -f /tmp/.ftpmaint.lck ]; then exit 0 fi /bin/touch /tmp/.ftpmaint.lck . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" get_dir_owner() { case $1 in core) echo "ftp:ftp-arch" ;; extra) echo "ftp:ftp-extra" ;; testing) echo "ftp:ftp-extra" ;; community) echo "root:tusers" ;; community-testing) echo "root:tusers" ;; esac } #adjust the nice level to run at a lower priority /usr/bin/renice +10 -p $$ > /dev/null cd /srv/ftp for d in $(get_repos_for_host); do owner="$(get_dir_owner $d)" /bin/chown -R $owner $d/os/{any,i686,x86_64} /bin/chmod -R g+w $d/os/{any,i686,x86_64} done /bin/chmod 555 /srv/ftp rm -f /tmp/.ftpmaint.lck