zwave-js-ui.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/usr/bin/env bash
  2. source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
  3. # Copyright (c) 2021-2023 tteck
  4. # Author: tteck (tteckster)
  5. # License: MIT
  6. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  7. function header_info {
  8. clear
  9. cat <<"EOF"
  10. _____ _______ __ ______
  11. /__ /_ ______ __ _____ / / ___/ / / / / _/
  12. / /| | /| / / __ `/ | / / _ \ __ / /\__ \ / / / // /
  13. / /_| |/ |/ / /_/ /| |/ / __/ / /_/ /___/ / / /_/ // /
  14. /____/__/|__/\__,_/ |___/\___/ \____//____/ \____/___/
  15. EOF
  16. }
  17. header_info
  18. echo -e "Loading..."
  19. APP="Zwave-JS-UI"
  20. var_disk="4"
  21. var_cpu="2"
  22. var_ram="1024"
  23. var_os="debian"
  24. var_version="11"
  25. variables
  26. color
  27. catch_errors
  28. function default_settings() {
  29. CT_TYPE="1"
  30. PW=""
  31. CT_ID=$NEXTID
  32. HN=$NSAPP
  33. DISK_SIZE="$var_disk"
  34. CORE_COUNT="$var_cpu"
  35. RAM_SIZE="$var_ram"
  36. BRG="vmbr0"
  37. NET=dhcp
  38. GATE=""
  39. DISABLEIP6="no"
  40. MTU=""
  41. SD=""
  42. NS=""
  43. MAC=""
  44. VLAN=""
  45. SSH="no"
  46. VERB="no"
  47. echo_default
  48. }
  49. function update_script() {
  50. header_info
  51. if [[ ! -d /opt/zwave-js-ui ]]; then
  52. msg_error "No ${APP} Installation Found!"
  53. exit
  54. fi
  55. 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) }')
  56. msg_info "Stopping Z-wave JS UI"
  57. systemctl stop zwave-js-ui.service
  58. msg_ok "Stopped Z-wave JS UI"
  59. msg_info "Updating Z-wave JS UI"
  60. wget https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
  61. unzip zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
  62. \cp -R zwave-js-ui-linux /opt/zwave-js-ui
  63. msg_ok "Updated Z-wave JS UI"
  64. msg_info "Starting Z-wave JS UI"
  65. systemctl enable --now zwave-js-ui.service
  66. msg_ok "Started Z-wave JS UI"
  67. msg_info "Cleanup"
  68. rm -rf zwave-js-ui-${RELEASE}-linux.zip zwave-js-ui-linux store
  69. msg_ok "Cleaned"
  70. msg_ok "Updated Successfully!\n"
  71. exit
  72. }
  73. ssh_check
  74. start
  75. build_container
  76. description
  77. echo -e "${APP} should be reachable by going to the following URL.
  78. ${BL}http://${IP}:8091${CL} \n"