From c13c2805acc4adf96b27835dd1d11b6499423199 Mon Sep 17 00:00:00 2001
From: CanbiZ <47820557+MickLesk@users.noreply.github.com>
Date: Mon, 3 Nov 2025 11:17:34 +0100
Subject: [PATCH] Update asterisk-install.sh
---
install/asterisk-install.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/install/asterisk-install.sh b/install/asterisk-install.sh
index 07557a072..20d5214ea 100644
--- a/install/asterisk-install.sh
+++ b/install/asterisk-install.sh
@@ -19,7 +19,7 @@ html=$(curl -fsSL "$ASTERISK_VERSIONS_URL")
LTS_VERSION=""
for major in 20 22 24 26; do
block=$(echo "$html" | awk "/Asterisk $major - LTS/,/
/")
- ver=$(echo "$block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+(\.[0-9]+)?' | head -n1 | sed -E 's/.* - //')
+ ver=$(echo "$block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+(\.[0-9]+)?' | head -n1 | sed -E 's/.* - //' || true)
if [ -n "$ver" ]; then
LTS_VERSION="$LTS_VERSION $ver"
fi
@@ -29,8 +29,8 @@ LTS_VERSION=$(echo "$LTS_VERSION" | xargs | tr ' ' '\n' | sort -V | tail -n1)
STD_VERSION=""
for major in 21 23 25 27; do
- block=$(echo "$html" | awk "/Asterisk $major,//")
- ver=$(echo "$block" | grep -oE 'Download (Latest - )?[0-9]+\.[0-9]+(\.[0-9]+)?' | head -n1 | sed -E 's/.* - //;s/Download //')
+ block=$(echo "$html" | grep -A 20 "Asterisk $major" | head -n 20)
+ ver=$(echo "$block" | grep -oE 'Download (Latest - )?'"$major"'\.[0-9]+\.[0-9]+' | head -n1 | sed -E 's/Download (Latest - )?//' || true)
if [ -n "$ver" ]; then
STD_VERSION="$STD_VERSION $ver"
fi
@@ -39,7 +39,7 @@ done
STD_VERSION=$(echo "$STD_VERSION" | xargs | tr ' ' '\n' | sort -V | tail -n1)
cert_block=$(echo "$html" | awk '/Certified Asterisk/,//')
-CERT_VERSION=$(echo "$cert_block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+-cert[0-9]+' | head -n1 | sed -E 's/.* - //')
+CERT_VERSION=$(echo "$cert_block" | grep -oE 'Download Latest - [0-9]+\.[0-9]+-cert[0-9]+' | head -n1 | sed -E 's/.* - //' || true)
cat <