1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Added welcome + clarified install dirs

This commit is contained in:
Bill Zimmerman 2017-05-19 16:33:01 +00:00
parent aa08e64043
commit 58c6b67f49

40
installers/common.sh Normal file → Executable file
View File

@ -4,37 +4,50 @@ version=`sed 's/\..*//' /etc/debian_version`
# Determine version and set default home location for lighttpd # Determine version and set default home location for lighttpd
if [ $version -ge 8 ]; then if [ $version -ge 8 ]; then
echo "Raspian verison is 8.0 or later" version_msg="Raspian version 8.0 or later"
webroot_dir="/var/www/html" webroot_dir="/var/www/html"
else else
echo "Raspian version is earlier than 8.0" version_msg="Raspian version earlier than 8.0"
webroot_dir="/var/www" webroot_dir="/var/www"
fi fi
# Outputs a RaspAP INSTALL log line # Outputs a RaspAP Install log line
function install_log() { function install_log() {
echo -e "\033[1;32mRaspAP INSTALL: $*\033[m" echo -e "\033[1;32mRaspAP Install: $*\033[m"
} }
# Outputs a RaspAP INSTALL ERROR log line and exits with status code 1 # Outputs a RaspAP Install Error log line and exits with status code 1
function install_error() { function install_error() {
echo -e "\033[1;37;41mRaspAP INSTALL ERROR: $*\033[m" echo -e "\033[1;37;41mRaspAP Install Error: $*\033[m"
exit 1 exit 1
} }
# Outputs a welcome message
function display_welcome() {
raspberry='\033[0;35m'
green='\033[1;32m'
echo -e "${raspberry}\n"
echo -e " 888888ba .d888888 888888ba"
echo -e " 88 8b d8 88 88 8b"
echo -e "a88aaaa8P' .d8888b. .d8888b. 88d888b. 88aaaaa88a a88aaaa8P"
echo -e " 88 8b. 88 88 Y8ooooo. 88 88 88 88 88"
echo -e " 88 88 88. .88 88 88. .88 88 88 88"
echo -e " dP dP 88888P8 88888P 88Y888P 88 88 dP"
echo -e " 88"
echo -e " dP"
echo -e "${green}"
echo -e "The Quick Installer will guide you through a few easy steps\n\n"
}
### NOTE: all the below functions are overloadable for system-specific installs ### NOTE: all the below functions are overloadable for system-specific installs
### NOTE: some of the below functions MUST be overloaded due to system-specific installs ### NOTE: some of the below functions MUST be overloaded due to system-specific installs
function config_installation() { function config_installation() {
install_log "Configure installation" install_log "Configure installation"
# This causes confusion. For the moment fix the default. echo "Detected ${version_msg}"
#echo -n "Install directory [${raspap_dir}]: "
#read input
#if [ ! -z "$input" ]; then
# raspap_dir="$input"
#fi
echo "Install directory: ${raspap_dir}" echo "Install directory: ${raspap_dir}"
echo "Lighttpd directory: ${webroot_dir}"
echo -n "Complete installation with these values? [y/N]: " echo -n "Complete installation with these values? [y/N]: "
read answer read answer
if [[ $answer != "y" ]]; then if [[ $answer != "y" ]]; then
@ -159,6 +172,7 @@ function install_complete() {
} }
function install_raspap() { function install_raspap() {
display_welcome
config_installation config_installation
update_system_packages update_system_packages
install_dependencies install_dependencies