diff --git a/ct/checkmk.sh b/ct/checkmk.sh index 34d362a52..8307fecf7 100644 --- a/ct/checkmk.sh +++ b/ct/checkmk.sh @@ -28,7 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | tr ' ' '\n' | grep -Ev 'rc|b' | sort -V | tail -n 1) + RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags?per_page=50 | jq -r '.[].name' | sed 's/^v//' | grep -Ev 'rc|b' | sort -V | tail -n 1) RELEASE="${RELEASE%%+*}" msg_info "Updating ${APP} to v${RELEASE}" $STD omd stop monitoring diff --git a/ct/flaresolverr.sh b/ct/flaresolverr.sh index 4f140ac1c..01b436d37 100644 --- a/ct/flaresolverr.sh +++ b/ct/flaresolverr.sh @@ -28,7 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if [[ $(grep -E '^VERSION_ID=' /etc/os-release) == *"12"* ]]; then + if [[ "$(get_os_version_major)" == "12" ]]; then msg_error "Wrong Debian version detected!" msg_error "You must upgrade your LXC to Debian Trixie before updating." exit diff --git a/ct/paperless-ngx.sh b/ct/paperless-ngx.sh index 3f98ac8dc..a45694c13 100644 --- a/ct/paperless-ngx.sh +++ b/ct/paperless-ngx.sh @@ -65,8 +65,7 @@ function update_script() { CLEAN_INSTALL=1 fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz" CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc" - . /etc/os-release - if [ "$VERSION_CODENAME" = "bookworm" ]; then + if [ "$(get_os_info codename)" = "bookworm" ]; then setup_gs else ensure_dependencies ghostscript @@ -140,8 +139,7 @@ function update_script() { CLEAN_INSTALL=1 fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz" CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc" - . /etc/os-release - if [ "$VERSION_CODENAME" = "bookworm" ]; then + if [ "$(get_os_info codename)" = "bookworm" ]; then setup_gs else msg_info "Installing Ghostscript" diff --git a/ct/photoprism.sh b/ct/photoprism.sh index 0717b68ff..1ed1bec76 100644 --- a/ct/photoprism.sh +++ b/ct/photoprism.sh @@ -42,7 +42,7 @@ function update_script() { fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz" - LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-bookworm-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1) + LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(get_os_info codename)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1) if [[ "${LIBHEIF_URL}" != "$(cat ~/.photoprism_libheif 2>/dev/null)" ]] || [[ ! -f ~/.photoprism_libheif ]]; then msg_info "Updating PhotoPrism LibHeif" ensure_dependencies libvips42 diff --git a/ct/proxmox-datacenter-manager.sh b/ct/proxmox-datacenter-manager.sh index c235f8915..449287bc8 100644 --- a/ct/proxmox-datacenter-manager.sh +++ b/ct/proxmox-datacenter-manager.sh @@ -28,7 +28,7 @@ function update_script() { exit fi - if grep -q 'Debian GNU/Linux 12' /etc/os-release && [ -f /etc/apt/sources.list.d/proxmox-release-bookworm.list ] && [ -f /etc/apt/sources.list.d/pdm-test.list ]; then + if [[ "$(get_os_version_major)" == "12" ]] && [ -f /etc/apt/sources.list.d/proxmox-release-bookworm.list ] && [ -f /etc/apt/sources.list.d/pdm-test.list ]; then msg_info "Updating outdated outdated source formats" echo "deb [signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pdm bookworm pdm-test" >/etc/apt/sources.list.d/pdm-test.list curl -fsSL https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -o /usr/share/keyrings/proxmox-archive-keyring.gpg @@ -37,7 +37,7 @@ function update_script() { msg_ok "Updated old sources" fi - if grep -q 'Debian GNU/Linux 13' /etc/os-release; then + if [[ "$(get_os_version_major)" == "13" ]]; then if [ -f "/etc/apt/sources.list.d/pdm-test.sources" ]; then if ! grep -qx "Enabled: false" "/etc/apt/sources.list.d/pdm-test.sources"; then echo "Enabled: false" >> "/etc/apt/sources.list.d/pdm-test.sources" diff --git a/ct/zabbix.sh b/ct/zabbix.sh index 984fc1c5b..4bd9a79cb 100644 --- a/ct/zabbix.sh +++ b/ct/zabbix.sh @@ -29,9 +29,8 @@ function update_script() { exit fi - . /etc/os-release - if [ "$VERSION_CODENAME" != "trixie" ]; then - msg_error "Unsupported Debian version: $VERSION_CODENAME – please upgrade to Debian 13 (Trixie) before updating Zabbix." + if [ "$(get_os_info codename)" != "trixie" ]; then + msg_error "Unsupported Debian version: $(get_os_info codename) – please upgrade to Debian 13 (Trixie) before updating Zabbix." exit fi diff --git a/install/checkmk-install.sh b/install/checkmk-install.sh index 154ded1a4..eff935aa7 100644 --- a/install/checkmk-install.sh +++ b/install/checkmk-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Install Checkmk" -RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | tr ' ' '\n' | grep -Ev 'rc|b' | sort -V | tail -n 1) +RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags?per_page=50 | jq -r '.[].name' | sed 's/^v//' | grep -Ev 'rc|b' | sort -V | tail -n 1) RELEASE="${RELEASE%%+*}" curl -fsSL "https://download.checkmk.com/checkmk/${RELEASE}/check-mk-raw-${RELEASE}_0.$(get_os_info codename)_amd64.deb" -o "/opt/checkmk.deb" $STD apt-get install -y /opt/checkmk.deb diff --git a/install/cockpit-install.sh b/install/cockpit-install.sh index aee48496a..53d6b3883 100644 --- a/install/cockpit-install.sh +++ b/install/cockpit-install.sh @@ -15,26 +15,25 @@ network_check update_os msg_info "Installing Cockpit" -source /etc/os-release cat </etc/apt/sources.list.d/debian-backports.sources Types: deb deb-src URIs: http://deb.debian.org/debian -Suites: ${VERSION_CODENAME}-backports +Suites: $(get_os_info codename)-backports Components: main Enabled: yes Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg EOF $STD apt update -$STD apt install -t ${VERSION_CODENAME}-backports cockpit cracklib-runtime --no-install-recommends -y +$STD apt install -t $(get_os_info codename)-backports cockpit cracklib-runtime --no-install-recommends -y sed -i "s/root//g" /etc/cockpit/disallowed-users msg_ok "Installed Cockpit" read -r -p "Would you like to install 45Drives' cockpit-file-sharing, cockpit-identities, and cockpit-navigator " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then install_45drives=true - if [[ "${VERSION_ID}" -ge 13 ]]; then - read -r -p "Debian ${VERSION_ID} is not officially supported by 45Drives yet, would you like to continue anyway? " prompt + if [[ "$(get_os_version_major)" -ge 13 ]]; then + read -r -p "Debian $(get_os_version_major) is not officially supported by 45Drives yet, would you like to continue anyway? " prompt if [[ ! "${prompt,,}" =~ ^(y|yes)$ ]]; then install_45drives=false fi diff --git a/install/lldap-install.sh b/install/lldap-install.sh index fca73160e..83a2d5688 100644 --- a/install/lldap-install.sh +++ b/install/lldap-install.sh @@ -15,17 +15,17 @@ network_check update_os msg_info "Installing lldap" -source /etc/os-release -os=$ID -if [ "$os" == "ubuntu" ]; then +OS_ID=$(get_os_info id) +OS_VERSION=$(get_os_info version) +if [ "$OS_ID" == "ubuntu" ]; then DISTRO="xUbuntu" else - DISTRO="${os^}" + DISTRO="${OS_ID^}" fi -curl -fsSL https://download.opensuse.org/repositories/home:Masgalor:LLDAP/${DISTRO}_${VERSION_ID}/Release.key | gpg --dearmor >/usr/share/keyrings/home_Masgalor_LLDAP.gpg +curl -fsSL https://download.opensuse.org/repositories/home:Masgalor:LLDAP/${DISTRO}_${OS_VERSION}/Release.key | gpg --dearmor >/usr/share/keyrings/home_Masgalor_LLDAP.gpg cat </etc/apt/sources.list.d/home:Masgalor:LLDAP.sources Types: deb -URIs: http://download.opensuse.org/repositories/home:/Masgalor:/LLDAP/${DISTRO}_${VERSION_ID}/ +URIs: http://download.opensuse.org/repositories/home:/Masgalor:/LLDAP/${DISTRO}_${OS_VERSION}/ Suites: / Signed-By: /usr/share/keyrings/home_Masgalor_LLDAP.gpg EOF diff --git a/install/mqtt-install.sh b/install/mqtt-install.sh index 32dd8dc8f..f4457321d 100644 --- a/install/mqtt-install.sh +++ b/install/mqtt-install.sh @@ -14,7 +14,6 @@ network_check update_os msg_info "Installing Mosquitto MQTT Broker" -source /etc/os-release $STD apt update $STD apt -y install mosquitto mosquitto-clients diff --git a/install/pangolin-install.sh b/install/pangolin-install.sh index b522551ac..6c1440b47 100644 --- a/install/pangolin-install.sh +++ b/install/pangolin-install.sh @@ -182,8 +182,7 @@ http: EOF $STD npm run db:push -. /etc/os-release -if [ "$VERSION_CODENAME" = "trixie" ]; then +if [ "$(get_os_info codename)" = "trixie" ]; then echo "net.ipv4.ip_forward=1" >>/etc/sysctl.d/sysctl.conf $STD sysctl -p /etc/sysctl.d/sysctl.conf else diff --git a/install/photoprism-install.sh b/install/photoprism-install.sh index 1d54199ce..421960581 100644 --- a/install/photoprism-install.sh +++ b/install/photoprism-install.sh @@ -40,7 +40,7 @@ msg_info "Installing PhotoPrism (Patience)" mkdir -p /opt/photoprism/{cache,config,photos,storage,temp} mkdir -p /opt/photoprism/photos/{originals,import} mkdir -p /opt/photoprism_backups -LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-bookworm-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1) +LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(get_os_info codename)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1) curl -fsSL "https://dl.photoprism.app/dist/libheif/$LIBHEIF_URL" -o /tmp/libheif.tar.gz tar -xzf /tmp/libheif.tar.gz -C /usr/local ldconfig diff --git a/install/wireguard-install.sh b/install/wireguard-install.sh index b14d7e15f..5ade271c6 100644 --- a/install/wireguard-install.sh +++ b/install/wireguard-install.sh @@ -31,8 +31,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then cd /etc/wgdashboard/src chmod u+x wgd.sh $STD ./wgd.sh install - . /etc/os-release - if [ "$VERSION_CODENAME" = "trixie" ]; then + if [ "$(get_os_info codename)" = "trixie" ]; then echo "net.ipv4.ip_forward=1" >>/etc/sysctl.d/sysctl.conf $STD sysctl -p /etc/sysctl.d/sysctl.conf else