#!/usr/bin/env bash
#
# Pulp initial server setup.
#

set -e

echo ""
echo "Generating RSA key pair and SSL CA certificate."
read -p "Proceed (y/n) [y]:" INPUT
INPUT=${INPUT:-y}
if [ ${INPUT} == 'y' ]
then
  pulp-gen-key-pair
  pulp-gen-ca-certificate
fi


echo ""
echo "Initialize the Pulp database."
read -p "Proceed (y/n) [y]:" INPUT
INPUT=${INPUT:-y}
if [ ${INPUT} == 'y' ]
then
  sudo -u apache pulp-manage-db
fi
