get PHP-TCP address and port
This commit is contained in:
parent
b8520834ce
commit
6642a38d28
4
.vscode/numbered-bookmarks.json
vendored
4
.vscode/numbered-bookmarks.json
vendored
@ -11,8 +11,8 @@
|
|||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
628,
|
||||||
553
|
538
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
52
setup.sh
52
setup.sh
@ -522,6 +522,56 @@ if [ "${usePHP}" -eq 1 ]; then
|
|||||||
done
|
done
|
||||||
fi
|
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'
|
: <<'COMMENTSECTION'
|
||||||
|
|
||||||
### Write configurations to template files
|
### Write configurations to template files
|
||||||
@ -592,6 +642,8 @@ echo -e "${cyan}--------------------${norm}"
|
|||||||
echo "usePHP: $usePHP"
|
echo "usePHP: $usePHP"
|
||||||
echo "PHP Version: $phpVersion"
|
echo "PHP Version: $phpVersion"
|
||||||
echo "PHP listen type: $phpType"
|
echo "PHP listen type: $phpType"
|
||||||
|
echo "PHP address: $phpAddr"
|
||||||
|
echo "PHP port: $phpPort"
|
||||||
echo -e "${mag}---------------------${norm}\n"
|
echo -e "${mag}---------------------${norm}\n"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user