This commit is contained in:
CanbiZ 2024-09-13 18:55:53 +02:00 committed by GitHub
parent ca46dd6c77
commit eb1d6bd717
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi fi
RELEASE=$(wget -q https://github.com/msgbyte/tianji/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP} Service" msg_info "Stopping ${APP} Service"
@ -68,7 +68,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v
msg_info "Updating ${APP} to ${RELEASE}" msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/tianji cd /opt/tianji
git checkout -q $RELEASE git checkout -q v${RELEASE}
pnpm db:migrate:apply >/dev/null 2>&1 pnpm db:migrate:apply >/dev/null 2>&1
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}" msg_ok "Updated ${APP} to ${RELEASE}"