diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index af47e80..222ce5b 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -11,8 +11,8 @@ -1, -1, -1, - -1, - 553 + 628, + 538 ] } ] diff --git a/setup.sh b/setup.sh index f3f1a9d..0da92e4 100644 --- a/setup.sh +++ b/setup.sh @@ -522,6 +522,56 @@ if [ "${usePHP}" -eq 1 ]; then done fi +# PHP-TCP: get address and port information +if [ "${phpType}" = "tcp" ]; then + while true; do + read -p "What IP address is PHP-FPM listening on? (default: 127.0.0.1) " inputPHPAddr + case "${inputPHPAddr}" in + '') + phpAddr="127.0.0.1" + break + ;; + [Xx]*) + echo -e "\n${cyan}---exiting---\n${norm}" + exit 1 + ;; + *) + # check basic format validity + if [[ "${inputPHPAddr}" =~ ^${regexIP6}$ ]] || [[ "${inputPHPAddr}" =~ ^${regexIP4}$ ]]; then + phpAddr="${inputPHPAddr}" + break + else + echo -e "\n${err}Invalid IP4/IP6 address format${norm}" + fi + ;; + esac + done + while true; do + read -p "What port is PHP-FPM listening on? (default: 9000) " inputPHPPort + case "${inputPHPPort}" in + '') + phpPort=9000 + break + ;; + [Xx]*) + echo -e "\n${cyan}---exiting---\n${norm}" + exit 1 + ;; + *) + # check port range validity + if [ "${inputPHPPort}" -ge 0 ] && [ "${inputPHPPort}" -le 65535 ]; then + phpPort="${inputPHPPort}" + break + else + echo -e "\n${err}Port must be between 0-65535${norm}" + fi + ;; + esac + done +fi + + + : <<'COMMENTSECTION' ### Write configurations to template files @@ -592,6 +642,8 @@ echo -e "${cyan}--------------------${norm}" echo "usePHP: $usePHP" echo "PHP Version: $phpVersion" echo "PHP listen type: $phpType" +echo "PHP address: $phpAddr" +echo "PHP port: $phpPort" echo -e "${mag}---------------------${norm}\n"