mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-23 18:33:00 +01:00
Compare commits
3 Commits
refactor/t
...
MickLesk-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
102805f8ce | ||
|
|
5c0a8d682d | ||
|
|
2cc0c738ed |
@@ -23,17 +23,18 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
RELEASE="0.301.1"
|
#RELEASE="0.301.1"
|
||||||
if [[ ! -f /etc/systemd/system/nocodb.service ]]; then
|
if [[ ! -f /etc/systemd/system/nocodb.service ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
if check_for_gh_release "nocodb" "nocodb/nocodb" "${RELEASE}"; then
|
#if check_for_gh_release "nocodb" "nocodb/nocodb" "${RELEASE}"; then
|
||||||
|
if check_for_gh_release "nocodb" "nocodb/nocodb"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop nocodb
|
systemctl stop nocodb
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "${RELEASE}" "/opt/nocodb/" "Noco-linux-x64"
|
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start nocodb
|
systemctl start nocodb
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "0.301.1" "/opt/nocodb/" "Noco-linux-x64"
|
fetch_and_deploy_gh_release "nocodb" "nocodb/nocodb" "singlefile" "latest" "/opt/nocodb/" "Noco-linux-x64"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/nocodb.service
|
cat <<EOF >/etc/systemd/system/nocodb.service
|
||||||
echo "[Unit]
|
[Unit]
|
||||||
Description=nocodb
|
Description=nocodb
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ get_cached_version() {
|
|||||||
cat "/var/cache/app-versions/${app}_version.txt"
|
cat "/var/cache/app-versions/${app}_version.txt"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -1100,9 +1100,8 @@ get_system_arch() {
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
create_temp_dir() {
|
create_temp_dir() {
|
||||||
local tmp_dir=$(mktemp -d)
|
local tmp_dir=$(mktemp -d)
|
||||||
# Callers should handle their own cleanup (rm -rf "$tmpdir")
|
# Set trap to cleanup on EXIT, ERR, INT, TERM
|
||||||
# Do NOT set trap here — it would overwrite global traps and only fire
|
trap "rm -rf '$tmp_dir'" EXIT ERR INT TERM
|
||||||
# when create_temp_dir() itself returns, not the calling function
|
|
||||||
echo "$tmp_dir"
|
echo "$tmp_dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5352,9 +5351,26 @@ function setup_java() {
|
|||||||
"main"
|
"main"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get currently installed version (use dpkg-query to avoid column truncation)
|
# Get currently installed version
|
||||||
local INSTALLED_VERSION=""
|
local INSTALLED_VERSION=""
|
||||||
INSTALLED_VERSION=$(dpkg-query -W -f '${Package}\n' 2>/dev/null | grep -oP '^temurin-\K[0-9]+(?=-jdk$)' | head -n1 || echo "")
|
if dpkg -l | grep -q "temurin-.*-jdk" 2>/dev/null; then
|
||||||
|
INSTALLED_VERSION=$(dpkg -l 2>/dev/null | awk '/temurin-.*-jdk/{print $2}' | grep -oP 'temurin-\K[0-9]+' | head -n1 || echo "")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Validate INSTALLED_VERSION is not empty if JDK package found
|
||||||
|
local JDK_COUNT=0
|
||||||
|
JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || true)
|
||||||
|
if [[ -z "$INSTALLED_VERSION" && "${JDK_COUNT:-0}" -gt 0 ]]; then
|
||||||
|
msg_warn "Found Temurin JDK but cannot determine version - attempting reinstall"
|
||||||
|
# Try to get actual package name for purge
|
||||||
|
local OLD_PACKAGE
|
||||||
|
OLD_PACKAGE=$(dpkg -l 2>/dev/null | awk '/temurin-.*-jdk/{print $2}' | head -n1 || echo "")
|
||||||
|
if [[ -n "$OLD_PACKAGE" ]]; then
|
||||||
|
msg_info "Removing existing package: $OLD_PACKAGE"
|
||||||
|
$STD apt purge -y "$OLD_PACKAGE" || true
|
||||||
|
fi
|
||||||
|
INSTALLED_VERSION="" # Reset to trigger fresh install
|
||||||
|
fi
|
||||||
|
|
||||||
# Scenario 1: Already at correct version
|
# Scenario 1: Already at correct version
|
||||||
if [[ "$INSTALLED_VERSION" == "$JAVA_VERSION" ]]; then
|
if [[ "$INSTALLED_VERSION" == "$JAVA_VERSION" ]]; then
|
||||||
@@ -7833,8 +7849,8 @@ function setup_uv() {
|
|||||||
local TMP_DIR=$(mktemp -d)
|
local TMP_DIR=$(mktemp -d)
|
||||||
local CACHED_VERSION
|
local CACHED_VERSION
|
||||||
|
|
||||||
# trap for TMP Cleanup (RETURN instead of EXIT to avoid overwriting global traps)
|
# trap for TMP Cleanup
|
||||||
trap "rm -rf '$TMP_DIR'" RETURN
|
trap "rm -rf '$TMP_DIR'" EXIT
|
||||||
|
|
||||||
CACHED_VERSION=$(get_cached_version "uv")
|
CACHED_VERSION=$(get_cached_version "uv")
|
||||||
|
|
||||||
@@ -8104,8 +8120,6 @@ function setup_docker() {
|
|||||||
local docker_installed=false
|
local docker_installed=false
|
||||||
local portainer_installed=false
|
local portainer_installed=false
|
||||||
local USE_DOCKER_REPO="${USE_DOCKER_REPO:-false}"
|
local USE_DOCKER_REPO="${USE_DOCKER_REPO:-false}"
|
||||||
local DOCKER_CURRENT_VERSION=""
|
|
||||||
local DOCKER_LATEST_VERSION=""
|
|
||||||
|
|
||||||
# Check if Docker is already installed
|
# Check if Docker is already installed
|
||||||
if command -v docker &>/dev/null; then
|
if command -v docker &>/dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user