Contains python control script, Android app code, schematics, and an installer script to automate installation on the Pi.
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.

35 lines
1.3 KiB

5 years ago
  1. #!/bin/bash
  2. echo "This script will install the bottlepy web server and allow you to control and monitor the state of your smart garage door opener."
  3. sleep 1
  4. echo "Before running this script, make sure you've configured your network and done a sudo apt update && sudo apt upgrade, so your system is up to date."
  5. sleep 1
  6. echo "The default password is xxxx. YOU MUST CHANGE THIS AS IT IS VERY INSECURE."
  7. sleep 1
  8. read -r -p "Press y to acknowledge and continue running the script. [y/N] " response
  9. if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
  10. then
  11. echo "Installing python3 and pip3..."
  12. sudo apt -y install python3 python3-pip python3-dev python3-rpi.gpio
  13. echo "Making directory..."
  14. mkdir garagedoor && cd garagedoor
  15. sleep 0.5
  16. echo "Installing Bottlepy..."
  17. pip3 install bottle
  18. sleep 0.5
  19. echo "Getting latest py file..."
  20. wget https://raw.githubusercontent.com/Rav4s/Pi-Garage-Door-Opener/master/Python_script_for_garage_door.py
  21. sleep 0.5
  22. echo "Editing /etc/rc.local for auto startup..."
  23. tac /etc/rc.local | sed '2 s@.*@python3 /home/pi/garagedoor/Python_script_for_garage_door.py &@' | tac
  24. sleep 0.5
  25. echo "Successful install! Rebooting in 5 seconds!"
  26. sleep 5
  27. sudo shutdown -r now
  28. else
  29. echo "Bye!"
  30. exit 1
  31. fi
  32. exit 0