Fix string comprehension
- "[[" syntax work only in "Bash"
This commit is contained in:
parent
0fcdc33783
commit
4eac410bce
@ -641,8 +641,7 @@ $(display_dn req "$req_in")
|
|||||||
|
|
||||||
# If type is server and no subjectAltName was requested,
|
# If type is server and no subjectAltName was requested,
|
||||||
# add one to the extensions file
|
# add one to the extensions file
|
||||||
if [[ "$crt_type" == 'server' ]]
|
if [ "$crt_type" = 'server' ]; then
|
||||||
then
|
|
||||||
echo "$EASYRSA_EXTRA_EXTS" |
|
echo "$EASYRSA_EXTRA_EXTS" |
|
||||||
grep -q subjectAltName ||
|
grep -q subjectAltName ||
|
||||||
print $(default_server_san "$req_in")
|
print $(default_server_san "$req_in")
|
||||||
@ -941,8 +940,7 @@ default_server_san() {
|
|||||||
awk -F'=' '/^ *CN=/{print $2}'
|
awk -F'=' '/^ *CN=/{print $2}'
|
||||||
)
|
)
|
||||||
echo "$cn" | egrep -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
|
echo "$cn" | egrep -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
|
||||||
if [[ $? -eq 0 ]]
|
if [ $? -eq 0 ]; then
|
||||||
then
|
|
||||||
print "subjectAltName = IP:$cn"
|
print "subjectAltName = IP:$cn"
|
||||||
else
|
else
|
||||||
print "subjectAltName = DNS:$cn"
|
print "subjectAltName = DNS:$cn"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user