diff --git a/installer.sh b/installer.sh index f97638d..9e757df 100755 --- a/installer.sh +++ b/installer.sh @@ -48,12 +48,12 @@ cecho () { tput sgr0; # Reset text attributes to normal without clearing screen. } -ESC=$(printf '\033') -RESET="${ESC}[0m" -CYAN="${ESC}[36m" +### Colors ## +ESC=$(printf '\033') RESET="${ESC}[0m" BLACK="${ESC}[30m" RED="${ESC}[31m" +GREEN="${ESC}[32m" YELLOW="${ESC}[33m" BLUE="${ESC}[34m" MAGENTA="${ESC}[35m" +CYAN="$ESC[36m" WHITE="${ESC}[37m" DEFAULT="${ESC}[39m" cyanprint() { printf "${CYAN}%s${RESET}\n" "$1"; } _process() { - #echo "$(date) PROCESSING: $@" echo -e "\n" cyanprint " → $@" } @@ -64,11 +64,12 @@ _success() { cecho -c 'blue' "Welcome to the RPi Dashboard installer!" read -p "This setup assumes you have a working web server installed that is up and running. Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 hostn="`hostname`" -cecho -c 'blue' "This setup will install the dashboard to /var/www/html.\nPlease choose your subfolder name, so you will be able to call the dashboard at http://$hostn/{your_subfolder_name}" +cecho -c 'blue' "This setup will install the dashboard to /var/www/html." +_process "Please choose your subfolder name, so you will be able to call the dashboard at http://$hostn/{your_subfolder_name}" read -p "Enter custom subfolder name: " subfoldern cd /var/www/html git clone https://github.com/femto-code/Raspberry-Pi-Dashboard $subfoldern -_process "Setting up valid permissions for /var/www/html/$subfoldern" +_process "Setting up valid permissions for /var/www/html/$subfoldern..." sudo chown -R ${whoami}:www-data /var/www/html/$subfoldern sudo chmod -R 775 /var/www/html/$subfoldern _success "Installation done! To access the dashboard open up a web browser with URL: http://$hostn/$subfoldern"