zwave-js-ui-install.sh 1.4 KB

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