Replace egrep with grep -E

This is an alternative to the proposed patch in #154 and is easier to
read than the change.

Closes #154.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
This commit is contained in:
Eric F Crist 2017-12-07 18:49:56 -06:00
parent e8cd6c9807
commit 7a29079efd
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
Easy-RSA 3 ChangeLog
3.0.4 (TBD)
* Remove use of egrep (#154)
3.0.3 (2017-08-22)
* Include mktemp windows binary
* copy CSR extensions into signed certificate

View File

@ -942,7 +942,7 @@ default_server_san() {
"$EASYRSA_OPENSSL" req -in "$path" -noout -subject -nameopt sep_multiline |
awk -F'=' '/^ *CN=/{print $2}'
)
echo "$cn" | egrep -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
if [ $? -eq 0 ]; then
print "subjectAltName = IP:$cn"
else