#!/bin/bash

function installwebcpp {

 ./configure && make && make install || exit 1
 exit 0
}

echo "This will compile Web C Plus Plus and run the installer."
echo "GNU Compiler Collection (gcc) 3.0 or higher is required"
echo "to compile it. Try \`/usr/sbin/gcc_select 3\` command if"
echo "both gcc 2.9.x and 3.x coexist on the same system."
echo ""
echo "You must also be root to install webcpp."
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
