This commit is contained in:
Slaviša Arežina 2025-08-04 14:38:48 +02:00 committed by GitHub
parent db86049a3e
commit dc5fcb83e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 17 deletions

View File

@ -27,15 +27,24 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_info "Updating ${APP}"
systemctl stop nocodb.service RELEASE=$(curl -fsSL https://api.github.com/repos/nocodb/nocodb/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
cd /opt/nocodb if [[ ! -f ~/.nocodb ]] || [[ "${RELEASE}" != "$(cat ~/.nocodb)" ]]; then
rm -rf nocodb msg_info "Stopping Service"
curl -fsSL http://get.nocodb.com/linux-x64 -o nocodb -L systemctl stop nocodb
chmod +x nocodb msg_ok "Stopped Service"
systemctl start nocodb.service
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
msg_info "Starting Service"
systemctl start nocodb
msg_ok "Started Service"
msg_ok "Updated Successfully" msg_ok "Updated Successfully"
exit else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
} }
start start

View File

@ -13,15 +13,10 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing NocoDB" fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
mkdir -p /opt/nocodb
cd /opt/nocodb
curl -fsSL http://get.nocodb.com/linux-x64 -o nocodb -L
chmod +x nocodb
msg_ok "Installed NocoDB"
msg_info "Creating Service" msg_info "Creating Service"
service_path="/etc/systemd/system/nocodb.service" cat <<EOF >/etc/systemd/system/nocodb.service
echo "[Unit] echo "[Unit]
Description=nocodb Description=nocodb
@ -33,7 +28,8 @@ WorkingDirectory=/opt/nocodb
ExecStart=/opt/nocodb/./nocodb ExecStart=/opt/nocodb/./nocodb
[Install] [Install]
WantedBy=multi-user.target" >$service_path WantedBy=multi-user.target
EOF
systemctl enable -q --now nocodb systemctl enable -q --now nocodb
msg_ok "Created Service" msg_ok "Created Service"