#!/bin/sh set -e REPOSITORY="/srv/$(hostname -f)/packages" VENDOR="$(hostname -d | awk -F. '{ print $1 }')" if [ ! -e "${REPOSITORY}/conf" ] then mkdir -p "${REPOSITORY}" # git clone reprepro "${REPOSITORY}/conf" fi cd "${REPOSITORY}" for FILE in conf/distributions conf/uploaders do if [ -e "${FILE}" ] || [ ! -e "${FILE}.${VENDOR}" ] then continue fi cp "${FILE}.${VENDOR}" "${FILE}" done reprepro -b "${REPOSITORY}" --delete createsymlinks for DIRECTORY in db conf do if [ ! -e "${DIRECTORY}" ] then continue fi chmod 0700 "${DIRECTORY}" done