diff --git a/ct/trilium.sh b/ct/trilium.sh index b9a847da7..83f93a2c3 100644 --- a/ct/trilium.sh +++ b/ct/trilium.sh @@ -27,10 +27,9 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt - fi - if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + if [[ ! -f /opt/${APP}_version.txt ]]; then touch /opt/${APP}_version.txt fi RELEASE=$(curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then msg_info "Stopping ${APP}" systemctl stop trilium sleep 1