Skip to content

Commit

Permalink
Update installer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
femto-code committed Nov 25, 2023
1 parent 59d9020 commit 0b00f91
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
}
Expand All @@ -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"

0 comments on commit 0b00f91

Please sign in to comment.