diff --git a/install b/install index ba22a1a..01e8d9c 100755 --- a/install +++ b/install @@ -263,8 +263,15 @@ wo_update_repo() { echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $wo_linux_codename main" >/etc/apt/sources.list.d/php.list fi # properly define mariadb repository + repo_file="/etc/apt/sources.list.d/wo-repo.list" if grep -q mariadb /etc/apt/sources.list.d/wo-repo.list; then - mariadb_repo=$(grep mariadb /etc/apt/sources.list.d/wo-repo.list | awk -F\ '{ print $3 }') + repo_number=$(grep -c "mariadb" "$repo_file") + if [ "$repo_number" -gt 1 ]; then + get_urls=$(grep "mariadb" "$repo_file" | awk '{print $3}') + mariadb_repo=$(echo "$get_urls" | sort -t '/' -k 6,6 -V | tail -n 1) + else + mariadb_repo=$(grep mariadb /etc/apt/sources.list.d/wo-repo.list | awk '{print $3}') + fi echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] $mariadb_repo $wo_linux_codename main" >/etc/apt/sources.list.d/mariadb.list fi # properly define redis repository