#!/bin/sh
# Main Menu script for The Warden
######################################################################

# Source our functions
PROGDIR="`pbreg get /PC-BSD/TheWarden/ProgDir`"

if [ -z "${PROGDIR}" ]
then
   echo "PROGDIR unset! Is The Warden installed properly?"
   exit 155
fi

# Source our variables
. ${PROGDIR}/conf/warden.conf

# Start our main menu loop
while
 dialog --title "The Warden" --menu "Main Menu" 15 45 5 manage "Manage Jails" new "New" import "Import" quit "Quit" 2>/tmp/.warden
do
 ANS=`cat /tmp/.warden`
 rm /tmp/.warden

 case $ANS in
    manage) ${PROGDIR}/scripts/managejails.sh ;;
    new) ${PROGDIR}/scripts/newjailmenu.sh ;;
    import) ${PROGDIR}/scripts/importjailmenu.sh ;;
    quit) exit 0 ;;

 esac

done

