mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-10 17:34:41 +00:00
Fix Z-Wave JS UI script (#546)
* Revert & Updated ZWave JS UI * Tweak for StorageDB
This commit is contained in:
parent
24cfb32c3d
commit
1cb822b34c
3 changed files with 46 additions and 47 deletions
|
@ -53,44 +53,33 @@ function default_settings() {
|
|||
}
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/zwave-js-ui ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
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) }')
|
||||
msg_info "Stopping Z-wave JS UI"
|
||||
systemctl stop zwave-js-ui.service
|
||||
msg_ok "Stopped Z-wave JS UI"
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/zwave-js-ui ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
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) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop zwave-js-ui
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating Z-wave JS UI"
|
||||
wget https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
|
||||
unzip zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
|
||||
\cp -R zwave-js-ui-linux /opt/zwave-js-ui
|
||||
service_path="/etc/systemd/system/zwave-js-ui.service"
|
||||
echo "[Unit]
|
||||
Description=zwave-js-ui
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/opt/zwave-js-ui
|
||||
ExecStart=/opt/zwave-js-ui/zwave-js-ui-linux
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >$service_path
|
||||
msg_ok "Updated Z-wave JS UI"
|
||||
msg_info "Updating Z-Wave JS UI"
|
||||
rm -rf /opt/zwave-js-ui/*
|
||||
cd /opt/zwave-js-ui
|
||||
wget -q https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip
|
||||
unzip -q zwave-js-ui-${RELEASE}-linux.zip
|
||||
msg_ok "Updated Z-Wave JS UI"
|
||||
|
||||
msg_info "Starting Z-wave JS UI"
|
||||
systemctl enable --now zwave-js-ui.service
|
||||
msg_ok "Started Z-wave JS UI"
|
||||
msg_info "Starting Service"
|
||||
systemctl start zwave-js-ui
|
||||
msg_ok "Started Service"
|
||||
|
||||
msg_info "Cleanup"
|
||||
rm -rf zwave-js-ui-${RELEASE}-linux.zip zwave-js-ui-linux store
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Updated Successfully!\n"
|
||||
exit
|
||||
msg_info "Cleanup"
|
||||
rm -rf /opt/zwave-js-ui/zwave-js-ui-${RELEASE}-linux.zip
|
||||
rm -rf /opt/zwave-js-ui/store
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Updated Successfully!\n"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue