#!/bin/sh
# Script which sets some inits some of the pbreg values that warden will be needing

PROGDIR="/usr/local/warden"
WORLDDIR="${PROGDIR}/worlds/defaultworld"
JAILDIR="${PROGDIR}/jails"

# Set our default config values
pbreg set /PC-BSD/TheWarden/ProgDir "${PROGDIR}"
pbreg set /PC-BSD/TheWarden/WorldSrc "/usr/src"
pbreg set /PC-BSD/TheWarden/WorldDir "${WORLDDIR}"
pbreg set /PC-BSD/TheWarden/TMPDIR "${PROGDIR}/tmp"
pbreg set /PC-BSD/TheWarden/JailDir "${JAILDIR}"

# Ask the user which nic to use
echo "Which network interface do you want to run jails on?"
echo -e "nic: \c"
read tmp

echo "Using $nic for jails"
pbreg set /PC-BSD/TheWarden/NIC "$tmp"

echo "This can be changed by running the following command at a later date:"
echo "pbreg set /PC-BSD/TheWarden/NIC <nic>"

# Warn the user about defaultworld
echo "Reminder: You will need to create a default world environment for creating new jails!"
echo "To do so, use the following commands in your /usr/src (or alternate source dir)"

echo "# cd /usr/src"
echo "# make buildworld installworld DESTDIR=${WORLDDIR}"
