#!/bin/sh
#
# Setup installer for Blackbox v0.0.3
# (C) 2006 Blackbox Staff
#
# This setup script is free software.
# We allow you to copy, distribute and modify
# under the condition that all copyrights stay
# in tact.
#
# Have a good time running our software.
# Thank you for choosing blackbox.
NOCOLOR="0"
NOINTRO="0"
while [ $# -ge 1 ] ; do
if [ $1 = "--help" ] ; then
echo "Config utility for Blackbox"
echo "-----------------------------"
echo "Syntax: ./Setup [options]"
echo "-nointro Skip intro (Welcome msg)"
echo "-nocolors Disables coloured setup."
exit 0
elif [ $1 = "-nointro" ] ; then
NOINTRO="1"
elif [ $1 = "-nocolors" -o $1 = "-nc" ] ; then
NOCOLOR="1"
fi
shift 1
done
clear
function COLOR () {
if [ $NOCOLOR = "0" ] ; then
echo -en "\033[$1m"
fi
}
function show_LOGO () {
COLOR "31"
echo "___. .__ __ ___. "
echo "\_ |__ | | _____ ____ | | _\_ |__ _______ ___"
echo " | __ \| | \__ \ _/ ___\| |/ /| __ \ / _ \ \/ /"
echo " | \_\ \ |__/ __ \\ \___| < | \_\ ( <_> > < "
echo " |___ /____(____ /\___ >__|_ \|___ /\____/__/\_ \ "
echo " \/ \/ \/ \/ \/ \/"
COLOR "0"
}
if [ $NOINTRO = "0" ] ; then
show_LOGO
COLOR "31"
echo -n "[Enter to continue]"
COLOR "0"
read cc
clear
fi
if [ $NOCOLOR = "0" ] ; then
echo -en "\033[31m"
fi
Q1="0"
show_LOGO
echo ""
COLOR "31"
echo "Wizard: Step 1 out of 3"
COLOR "34"
while [ $Q1 = "0" ] ; do
echo ""
echo "Are you logged in under the username,"
echo "you are about to use to run blackbox?"
if [ $NOCOLOR = "0" ] ; then
echo -ne "\033[34m[\033[36m$USER\033[34m] \033[36m-> \033[37m$c"
else
echo -n "[$TEST] -> $c"
fi
read cc
COLOR "31"
if [ $cc ] ; then
if [ $cc = "yes" ] ; then
echo "Good!"
Q1="yes"
elif [ $cc = "no" ] ; then
echo "PLEASE login as the user to run blackbox on."
COLOR "0"
exit 0
fi
else
echo "You can only specify yes or no."
echo "Meaning `eval echo $c` isn't a correct answer!"
fi
done
COLOR "0"