podman-homeassistant-install.sh 1.3 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. msg_ok "Installed Dependencies"
  18. msg_info "Installing Podman"
  19. $STD apt-get -y install podman
  20. $STD systemctl enable --now podman.socket
  21. msg_ok "Installed Podman"
  22. msg_info "Pulling Home Assistant Image"
  23. $STD podman pull docker.io/homeassistant/home-assistant:stable
  24. msg_ok "Pulled Home Assistant Image"
  25. msg_info "Installing Home Assistant"
  26. $STD podman volume create hass_config
  27. $STD podman run -d \
  28. --name homeassistant \
  29. --restart unless-stopped \
  30. -v /dev:/dev \
  31. -v hass_config:/config \
  32. -v /etc/localtime:/etc/localtime:ro \
  33. -v /etc/timezone:/etc/timezone:ro \
  34. --net=host \
  35. homeassistant/home-assistant:stable
  36. podman generate systemd \
  37. --new --name homeassistant \
  38. >/etc/systemd/system/homeassistant.service
  39. $STD systemctl enable --now homeassistant
  40. msg_ok "Installed Home Assistant"
  41. motd_ssh
  42. customize
  43. msg_info "Cleaning up"
  44. $STD apt-get autoremove
  45. $STD apt-get autoclean
  46. msg_ok "Cleaned"