#! /bin/sh base=${PREFIX}/etc/cvsup variables="user group cuser cgroup host host_crypto interval \ maxclients facility distribs" ask() { local question default answer question=$1 default=$2 if [ -z "${PACKAGE_BUILDING}" ]; then read -p "${question} [${default}]? " answer fi if [ x${answer} = x ]; then answer=${default} fi echo ${answer} } yesno() { local dflt question answer question=$1 dflt=$2 while :; do answer=$(ask "${question}" "${dflt}") case "${answer}" in [Yy]*) return 0;; [Nn]*) return 1;; esac echo "Please answer yes or no." done } ask_distrib() { local desc dflt link dir subdir link=$1 dflt=$2 subdir=$3 desc=$4 if yesno "Do you wish to mirror the ${desc}" y; then if [ "${subdir}" != "." ]; then cat </dev/null 2>&1; then break fi echo "Please answer with a number" done #------------------------------------------------------------------------------ echo "" echo -n "Building the \"config.sh\" file ... " for var in ${variables}; do eval echo ${var}=\\\"\${${var}}\\\" done > ${WRKSRC}/config.sh echo "Done." echo -n "Building the \"cvsupd.access\" file ... " cat < ${WRKSRC}/cvsupd.access -0.0.0.0/0 ${maxclients} # Limit total connections -0.0.0.0/0/32 1 # Allow only 1 connection from each host +0.0.0.0/0 # If we reach this rule, we let the client in EOF echo "Done."