This commit is contained in:
Slaviša Arežina
2025-08-04 09:15:32 +02:00
committed by GitHub
parent 46728b01fe
commit 1c7a39438c
3 changed files with 26 additions and 16 deletions

View File

@@ -27,13 +27,28 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP"
systemctl stop pairdrop
cd /opt/pairdrop
git pull
npm install
systemctl start pairdrop
msg_ok "Updated $APP"
RELEASE=$(curl -fsSL https://api.github.com/repos/schlagmichdoch/PairDrop/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f ~/.pairdrop ]] || [[ "${RELEASE}" != "$(cat ~/.pairdrop)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop pairdrop
msg_ok "Stopped ${APP}"
fetch_and_deploy_gh_release "pairdrop" "schlagmichdoch/PairDrop" "tarball"
msg_info "Configuring PairDrop"
cd /opt/pairdrop
$STD npm install
msg_ok "Configured PairDrop"
msg_info "Starting ${APP}"
systemctl start pairdrop
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."
fi
exit
}
@@ -44,4 +59,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"