Check status of command, not exit-code, in default_server_san()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
60f3fc2728
commit
adc2cbed58
@ -1991,10 +1991,8 @@ default_server_san() {
|
||||
easyrsa_openssl req -in "$path" -noout -subject -nameopt sep_multiline |
|
||||
awk -F'=' '/^ *CN=/{print $2}'
|
||||
)
|
||||
echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
|
||||
# Check exit code directly with e.g. if mycmd;, not indirectly with $?.
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
if echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'; then
|
||||
print "subjectAltName = IP:$cn"
|
||||
else
|
||||
print "subjectAltName = DNS:$cn"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user