refactor: use shared get_lxc_ip and get_latest_github_release helpers in addon scripts

- pyenv.sh, webmin.sh, netdata.sh: replace manual hostname -I parsing with get_lxc_ip/$LOCAL_IP
- phpmyadmin.sh: replace manual curl|grep|cut GitHub API version lookup with get_latest_github_release
This commit is contained in:
MickLesk
2026-08-01 23:20:13 +02:00
parent fc21e2c458
commit 6ad7dda1ec
4 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -112,11 +112,11 @@ function install_php_and_modules() {
function install_phpmyadmin() {
msg_info "Fetching latest phpMyAdmin release from GitHub"
LATEST_VERSION_RAW=$(curl -fsSL https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4)
LATEST_VERSION_RAW=$(get_latest_github_release "phpmyadmin/phpmyadmin" false) || true
LATEST_VERSION=$(echo "$LATEST_VERSION_RAW" | sed -e 's/^RELEASE_//' -e 's/_/./g')
if [[ -z "$LATEST_VERSION" ]]; then
msg_error "Could not determine latest phpMyAdmin version from GitHub falling back to 5.2.2"
LATEST_VERSION="RELEASE_5_2_2"
LATEST_VERSION="5.2.2"
fi
msg_ok "Latest version: $LATEST_VERSION"
@@ -217,7 +217,7 @@ function uninstall_phpmyadmin() {
function update_phpmyadmin() {
msg_info "Fetching latest phpMyAdmin release from GitHub"
LATEST_VERSION_RAW=$(curl -fsSL https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4)
LATEST_VERSION_RAW=$(get_latest_github_release "phpmyadmin/phpmyadmin" false) || true
LATEST_VERSION=$(echo "$LATEST_VERSION_RAW" | sed -e 's/^RELEASE_//' -e 's/_/./g')
if [[ -z "$LATEST_VERSION" ]]; then