Update phpmyadmin.sh

This commit is contained in:
CanbiZ 2025-04-29 11:29:40 +02:00
parent 8b54aa81c9
commit 17f81ab64d

View File

@ -102,7 +102,8 @@ function install_php_and_modules() {
function install_phpmyadmin() { function install_phpmyadmin() {
msg_info "Fetching latest phpMyAdmin release from GitHub" msg_info "Fetching latest phpMyAdmin release from GitHub"
LATEST_VERSION=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4) LATEST_VERSION_RAW=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep tag_name | cut -d '"' -f4)
LATEST_VERSION=$(echo "$LATEST_VERSION_RAW" | sed -e 's/^RELEASE_//' -e 's/_/./g')
if [[ -z "$LATEST_VERSION" ]]; then if [[ -z "$LATEST_VERSION" ]]; then
msg_error "Could not determine latest phpMyAdmin version from GitHub falling back to 5.2.2" msg_error "Could not determine latest phpMyAdmin version from GitHub falling back to 5.2.2"
LATEST_VERSION="RELEASE_5_2_2" LATEST_VERSION="RELEASE_5_2_2"
@ -156,17 +157,13 @@ EOF
fi fi
} }
echo -e "${YW}⚠️ ${APP} will now be installed.${CL}"
read -r -p "Enter port number (Default: ${DEFAULT_PORT}): " PORT
PORT=${PORT:-$DEFAULT_PORT}
read -r -p "Would you like to install ${APP}? (y/n): " install_prompt read -r -p "Would you like to install ${APP}? (y/n): " install_prompt
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
check_internet check_internet
install_php_and_modules install_php_and_modules
install_phpmyadmin install_phpmyadmin
configure_phpmyadmin configure_phpmyadmin
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://${IP}:${PORT}${CL}" echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://${IP}/phpMyAdmin${CL}"
else else
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}" echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
exit 0 exit 0