esphome-install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y git
  18. msg_ok "Installed Dependencies"
  19. msg_info "Updating Python3"
  20. $STD apt-get install -y \
  21. python3 \
  22. python3-dev \
  23. python3-pip \
  24. python3-venv
  25. msg_ok "Updated Python3"
  26. msg_info "Installing ESPHome"
  27. #mkdir /srv/esphome
  28. #cd /srv/esphome
  29. #python3 -m venv .
  30. #source bin/activate
  31. $STD pip install esphome tornado esptool
  32. msg_ok "Installed ESPHome"
  33. msg_info "Creating Service"
  34. cat <<EOF >/etc/systemd/system/esphomeDashboard.service
  35. [Unit]
  36. Description=ESPHome Dashboard
  37. After=network.target
  38. [Service]
  39. #ExecStart=/srv/esphome/bin/esphome dashboard /root/config/
  40. ExecStart=/usr/local/bin/esphome dashboard /root/config/
  41. Restart=always
  42. User=root
  43. [Install]
  44. WantedBy=multi-user.target
  45. EOF
  46. systemctl enable -q --now esphomeDashboard.service
  47. msg_ok "Created Service"
  48. motd_ssh
  49. customize
  50. msg_info "Cleaning up"
  51. $STD apt-get autoremove
  52. $STD apt-get autoclean
  53. msg_ok "Cleaned"