phpAddr enclose IP6 in [square brackets]

This commit is contained in:
Asif Bacchus 2019-01-08 01:33:37 -07:00
parent 60e1a34c8f
commit a83e0da7fa
2 changed files with 9 additions and 6 deletions

View File

@ -6,13 +6,13 @@
-1, -1,
19, 19,
54, 54,
751, 754,
68, 68,
-1, -1,
-1, -1,
-1, -1,
640, -1,
616 -1
] ]
} }
] ]

View File

@ -592,8 +592,11 @@ if [ "${phpType}" = "tcp" ]; then
exit 1 exit 1
;; ;;
*) *)
# check basic format validity # check basic format validity and wrap IP6 in [square brackets]
if [[ "${inputPHPAddr}" =~ ^${regexIP6}$ ]] || [[ "${inputPHPAddr}" =~ ^${regexIP4}$ ]]; then if [[ "${inputPHPAddr}" =~ ^${regexIP6}$ ]]; then
phpAddr="[${inputPHPAddr}]"
break
elif [[ "${inputPHPAddr}" =~ ^${regexIP4}$ ]]; then
phpAddr="${inputPHPAddr}" phpAddr="${inputPHPAddr}"
break break
else else
@ -762,7 +765,7 @@ echo "KeyPath: $KeyPath"
echo "noOSCP: $noOSCP" echo "noOSCP: $noOSCP"
echo "CA-Chain: $CAChainPath" echo "CA-Chain: $CAChainPath"
echo "DHPath: $DHPath" echo "DHPath: $DHPath"
echo "Generating DH Params? $generateDH" echo "Generating DH Params: $generateDH"
echo -e "${cyan}--------------------${norm}" echo -e "${cyan}--------------------${norm}"
echo "usePHP: $usePHP" echo "usePHP: $usePHP"
echo "PHP listen type: $phpType" echo "PHP listen type: $phpType"