deconz-install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 gnupg
  18. msg_ok "Installed Dependencies"
  19. msg_info "Setting Phoscon Repository"
  20. $STD apt-key add <(curl -fsSL http://phoscon.de/apt/deconz.pub.key)
  21. sh -c "echo 'deb [arch=amd64] http://phoscon.de/apt/deconz $(lsb_release -cs) main' > /etc/apt/sources.list.d/deconz.list"
  22. msg_ok "Setup Phoscon Repository"
  23. msg_info "Installing deConz"
  24. $STD apt-get update
  25. $STD apt-get install -y deconz
  26. msg_ok "Installed deConz"
  27. msg_info "Creating Service"
  28. service_path="/lib/systemd/system/deconz.service"
  29. echo "[Unit]
  30. Description=deCONZ: ZigBee gateway -- REST API
  31. Wants=deconz-init.service deconz-update.service
  32. StartLimitIntervalSec=0
  33. [Service]
  34. User=root
  35. ExecStart=/usr/bin/deCONZ -platform minimal --http-port=80
  36. Restart=on-failure
  37. RestartSec=30
  38. AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_KILL CAP_SYS_BOOT CAP_SYS_TIME
  39. [Install]
  40. WantedBy=multi-user.target" >$service_path
  41. $STD systemctl enable --now deconz
  42. msg_ok "Created Service"
  43. motd_ssh
  44. customize
  45. msg_info "Cleaning up"
  46. $STD apt-get autoremove
  47. $STD apt-get autoclean
  48. msg_ok "Cleaned"