Refactor: NodeBB (#6419)

This commit is contained in:
Slaviša Arežina
2025-08-01 07:25:00 +02:00
committed by GitHub
parent f80c7008a8
commit da217bb3e0
2 changed files with 11 additions and 15 deletions

View File

@ -32,7 +32,7 @@ function update_script() {
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/NodeBB/NodeBB/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
if [[ "${RELEASE}" != "$(cat ~/.nodebb)" ]] || [[ ! -f ~/.nodebb ]]; then
msg_info "Stopping ${APP}"
systemctl stop nodebb
msg_ok "Stopped ${APP}"
@ -40,13 +40,14 @@ function update_script() {
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt/nodebb
$STD ./nodebb upgrade
echo "${RELEASE}" >/opt/${APP}_version.txt
echo "${RELEASE}" > ~/.nodebb
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting ${APP}"
systemctl start nodebb
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
msg_ok "Updated Successfully\n"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}."
fi
@ -60,4 +61,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}:4567${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:4567${CL}"