A rewrite of the Raspberry Pi Garage Door Opener using Flask
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. #!/bin/bash
  2. echo "This script will install the Flask web server and allow you to control and monitor the state of your smart garage door opener."
  3. sleep 0.5
  4. read -r -p "Press y to acknowledge and continue running the script. [y/N] " response
  5. if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
  6. then
  7. echo "Updating apt package data..."
  8. sudo apt-get update
  9. echo "Installing python3, rpi-gpio, and git..."
  10. sudo apt-get -y install python3 python3-dev python3-rpi.gpio git-all
  11. echo "Installing Flask..."
  12. pip3 install flask
  13. echo "Making directory..."
  14. mkdir garagedoor && cd garagedoor
  15. echo "Cloning repository..."
  16. git clone https://github.com/Rav4s/New-Pi-Garage-Door-Opener.git .
  17. echo "Copying systemd unit file..."
  18. sudo cp garage-door-controller.service /etc/systemd/system/garage-door-controller.service
  19. echo "Reloading systemd configuration..."
  20. sudo systemctl daemon-reload
  21. echo "Enabling and starting systemd service..."
  22. sudo systemctl enable --now garage-door-controller.service
  23. sleep 0.5
  24. echo "Successful install!"
  25. echo "Your web server is now accessible at localhost:1235"
  26. else
  27. echo "Bye!"
  28. exit 1
  29. fi
  30. exit 0