esphome-install.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "Installing Python3-pip"
  20. $STD apt-get install -y python3-pip
  21. msg_ok "Installed Python3-pip"
  22. msg_info "Installing ESPHome"
  23. $STD pip3 install esphome
  24. msg_ok "Installed ESPHome"
  25. msg_info "Installing ESPHome Dashboard"
  26. $STD pip3 install tornado esptool
  27. service_path="/etc/systemd/system/esphomeDashboard.service"
  28. echo "[Unit]
  29. Description=ESPHome Dashboard
  30. After=network.target
  31. [Service]
  32. ExecStart=/usr/local/bin/esphome dashboard /root/config/
  33. Restart=always
  34. User=root
  35. [Install]
  36. WantedBy=multi-user.target" >$service_path
  37. $STD systemctl enable esphomeDashboard.service
  38. systemctl start esphomeDashboard
  39. msg_ok "Installed ESPHome Dashboard"
  40. motd_ssh
  41. customize
  42. msg_info "Cleaning up"
  43. $STD apt-get autoremove
  44. $STD apt-get autoclean
  45. msg_ok "Cleaned"