Refactor (#6548)
This commit is contained in:
parent
db86049a3e
commit
dc5fcb83e8
23
ct/nocodb.sh
23
ct/nocodb.sh
@ -27,14 +27,23 @@ 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"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user