Files
ProxmoxVE/install/zwave-js-ui-install.sh
T

57 lines
1.6 KiB
Bash
Raw Normal View History

2023-03-22 20:48:20 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
2023-03-22 20:48:20 -04:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://zwave-js.github.io/zwave-js-ui/#/
2023-03-22 20:48:20 -04:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2023-03-22 20:48:20 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Z-Wave JS UI"
2024-11-28 05:48:58 +01:00
mkdir -p /opt/zwave-js-ui
mkdir -p /opt/zwave_store
2023-03-22 20:48:20 -04:00
cd /opt/zwave-js-ui
RELEASE=$(curl -fsSL https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
2025-04-01 10:58:29 +02:00
curl -fsSL "https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip" -o $(basename "https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip")
2024-11-28 05:48:58 +01:00
unzip -q zwave-js-ui-${RELEASE}-linux.zip
cat <<EOF >/opt/.env
ZWAVEJS_EXTERNAL_CONFIG=/opt/zwave_store/.config-db
STORE_DIR=/opt/zwave_store
EOF
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
2023-03-22 20:48:20 -04:00
msg_ok "Installed Z-Wave JS UI"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/zwave-js-ui.service
2024-11-28 05:48:58 +01:00
[Unit]
2023-03-22 20:48:20 -04:00
Description=zwave-js-ui
Wants=network-online.target
After=network-online.target
2024-11-28 05:48:58 +01:00
2023-03-22 20:48:20 -04:00
[Service]
User=root
WorkingDirectory=/opt/zwave-js-ui
2023-12-01 19:03:26 -05:00
ExecStart=/opt/zwave-js-ui/zwave-js-ui-linux
2024-11-28 05:48:58 +01:00
EnvironmentFile=/opt/.env
2023-03-22 20:48:20 -04:00
[Install]
2024-11-28 05:48:58 +01:00
WantedBy=multi-user.target
EOF
systemctl enable -q --now zwave-js-ui
2023-03-22 20:48:20 -04:00
msg_ok "Created Service"
motd_ssh
2023-05-15 07:39:30 -04:00
customize
2023-03-22 20:48:20 -04:00
msg_info "Cleaning up"
rm zwave-js-ui-${RELEASE}-linux.zip
2024-06-02 08:00:22 -04:00
$STD apt-get -y autoremove
$STD apt-get -y autoclean
2023-03-22 20:48:20 -04:00
msg_ok "Cleaned"