#!/bin/sh set -u set -e PREFIX_DIR="" # declare the Bareos repository DOWNLOADSERVER=download.bareos.org URL="https://download.bareos.org/experimental/PR-2039/FreeBSD_13.3" # setup credentials # (required for download.bareos.com, subscription) BAREOS_USERNAME="username_at_example.com" BAREOS_PASSWORD="MySecretBareosPassword" if [ "${DOWNLOADSERVER}" = "download.bareos.com" ]; then scheme="$(echo "${URL}" | cut -d / -f 1)" rest="$(echo "${URL}" | cut -d / -f 3-)" URL="${scheme}//${BAREOS_USERNAME}:${BAREOS_PASSWORD}@${rest}" fi mkdir -p "${PREFIX_DIR}/usr/local/etc/pkg/repos" cat << EOT > "${PREFIX_DIR}/usr/local/etc/pkg/repos/bareos.conf" Bareos: { url: "${URL}", mirror_type: "none", signature_type: "none", enabled: yes } EOT chmod 0640 "${PREFIX_DIR}/usr/local/etc/pkg/repos/bareos.conf" echo "Repository ${URL} successfully added."