#!/bin/bash

function installwebcpp {

 ./configure && make && ./install_nc.sh || exit 1
 exit 0
}

echo "This will compile Web C Plus Plus and run the installer."
echo "You are required to have a C++ compiler, and dialog installed."
echo "You must also be root to install webcpp to the default directory."
echo ""

YESNO=""

while [ "$YESNO" != "n" ]; do

 echo -n "Are you ready to continue? (Y/N) "
 read YESNO

 if [ "$YESNO" = "Y" ]; then
  installwebcpp
 fi

 if [ "$YESNO" = "y" ]; then
  installwebcpp
 fi

 if [ "$YESNO" = "N" ]; then
  echo "Aborting installation..."
  exit 1
 fi

done

echo "Aborting installation..."
exit 1
