This commit is contained in:
Slaviša Arežina
2025-07-05 18:02:58 +02:00
committed by GitHub
parent f7e9fbc473
commit e5bea1f49a
2 changed files with 6 additions and 9 deletions

View File

@ -29,7 +29,7 @@ function update_script() {
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
if [[ "${RELEASE}" != "$(cat ~/.dashy 2>/dev/null)" ]] || [[ ! -f ~/.dashy ]]; then
msg_info "Stopping ${APP}"
systemctl stop dashy
msg_ok "Stopped ${APP}"
@ -43,14 +43,13 @@ function update_script() {
fi
msg_ok "Backed up conf.yml"
msg_info "Updating ${APP} to ${RELEASE}"
rm -rf /opt/dashy
mkdir -p /opt/dashy
curl -fsSL "https://github.com/Lissy93/dashy/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz -C /opt/dashy --strip-components=1
fetch_and_deploy_gh_release "dashy" "Lissy93/dashy"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/dashy
npm install
npm run build
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Restoring conf.yml"
@ -65,6 +64,7 @@ function update_script() {
msg_info "Starting Dashy"
systemctl start dashy
msg_ok "Started Dashy"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"

View File

@ -14,15 +14,12 @@ network_check
update_os
NODE_VERSION="22" setup_nodejs
fetch_and_deploy_gh_release "dashy" "Lissy93/dashy"
RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
msg_info "Installing Dashy ${RELEASE} (Patience)"
mkdir -p /opt/dashy
curl -fsSL "https://github.com/Lissy93/dashy/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz -C /opt/dashy --strip-components=1
cd /opt/dashy
$STD npm install
$STD npm run build
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Dashy ${RELEASE}"
msg_info "Creating Service"