#!/bin/bash -e

printf "Usage: $0 [<host> [batch-mode]]\n\n"

if [ -n "${1}" ]; then
	HOST="${1}"
else
	HOST="admin@$(hostname -f):8066"
fi

if [ "${2}" != "batch-mode" ]; then
	cat <<EOF
Automatically run the whole 'Admin Quickstart', all defaults,
Debian wizards, completely non-interactive.

Just give the admin password once when asked.

This is for quick bootstrapping to test-drive it, debugging and
very hasty lads.

Don't use if for, or on an existing production setup!
This will run for quite some time!
This will automatically download (most likely from internet) tons of data!

EOF
	read -p"Ctr-C to abort, RETURN to continue" dummy
fi

MBDT="mini-buildd-tool --verbose ${HOST}"

${MBDT} autosetup

# Build keyring packages
${MBDT} meta repository.Repository build_keyring_packages

# Build test packages
${MBDT} meta repository.Repository build_test_packages
