zwave-js-ui-install.sh 1.4 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 unzip
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing Z-Wave JS UI"
  20. mkdir /opt/zwave-js-ui
  21. cd /opt/zwave-js-ui
  22. RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
  23. $STD wget https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip
  24. $STD unzip zwave-js-ui-${RELEASE}-linux.zip
  25. msg_ok "Installed Z-Wave JS UI"
  26. msg_info "Creating Service"
  27. service_path="/etc/systemd/system/zwave-js-ui.service"
  28. echo "[Unit]
  29. Description=zwave-js-ui
  30. Wants=network-online.target
  31. After=network-online.target
  32. [Service]
  33. User=root
  34. WorkingDirectory=/opt/zwave-js-ui
  35. ExecStart=/opt/zwave-js-ui/zwave-js-ui-linux
  36. [Install]
  37. WantedBy=multi-user.target" >$service_path
  38. systemctl start zwave-js-ui
  39. $STD systemctl enable zwave-js-ui
  40. msg_ok "Created Service"
  41. motd_ssh
  42. root
  43. msg_info "Cleaning up"
  44. rm zwave-js-ui-${RELEASE}-linux.zip
  45. $STD apt-get autoremove
  46. $STD apt-get autoclean
  47. msg_ok "Cleaned"