Files
cyphernode/install/script/setup.sh
2018-12-26 14:52:52 -05:00

41 lines
719 B
Bash
Executable File

#!/bin/bash
. ./trace.sh
. ./configure.sh
. ./install.sh
CONFIGURE=0
INSTALL=0
RECREATE=0
while getopts ":cir" opt; do
case $opt in
r)
RECREATE=1
;;
c)
CONFIGURE=1
;;
i)
INSTALL=1
;;
\?)
echo "Invalid option: -$OPTARG. Use -c to configure and -i to install" >&2
;;
esac
done
if [[ $CONFIGURE == 0 && $INSTALL == 0 && RECREATE == 0 ]]; then
echo "Please use -c to configure, -i to install and -ci to do both. Use -r to recreate config files."
else
if [[ $CONFIGURE == 1 ]]; then
trace "Starting configuration phase"
configure $RECREATE
fi
if [[ $INSTALL == 1 ]]; then
trace "Starting installation phase"
install
fi
fi