phpPort check for letters

This commit is contained in:
Asif Bacchus 2019-01-08 01:28:41 -07:00
parent 95eaf051f4
commit 60e1a34c8f
2 changed files with 10 additions and 7 deletions

View File

@ -6,13 +6,13 @@
-1,
19,
54,
748,
751,
68,
-1,
-1,
-1,
637,
738
640,
616
]
}
]

View File

@ -614,12 +614,15 @@ if [ "${phpType}" = "tcp" ]; then
exit 1
;;
*)
# check port range validity
if [ "${inputPHPPort}" -ge 0 ] && [ "${inputPHPPort}" -le 65535 ]; then
## check port range validity
# check for letters
if [[ "${inputPHPPort}" =~ .*[a-zA-Z].* ]]; then
echo -e "\n${err}Port value must be numeric with no letters${norm}"
elif [ ! "${inputPHPPort}" -ge 0 ] || [ ! "${inputPHPPort}" -le 65535 ]; then
echo -e "\n${err}Port must be between 0-65535${norm}"
else
phpPort="${inputPHPPort}"
break
else
echo -e "\n${err}Port must be between 0-65535${norm}"
fi
;;
esac