support old getent implementation
This commit is contained in:
parent
9229ff93e5
commit
c17a7b98b6
@ -176,7 +176,8 @@ extendedKeyUsage = serverAuth"
|
||||
# Gather IPs for SAN
|
||||
|
||||
i=1
|
||||
IPS="$(getent ahostsv4 $(hostname) | awk '{print $1}' |sort | uniq)"
|
||||
IPS="$( (getent ahostsv4 $(hostname) 2>/dev/null || getent hosts $(hostname) 2>/dev/null) | awk '{print $1}' |sort | uniq)"
|
||||
|
||||
echo "[${ME}] Found these IPs: " ${IPS}
|
||||
PAYLOAD="subjectAltName = @alt_names\n[ alt_names ]\n$(for IP in $IPS; do echo "IP.${i} = ${IP}" ; i=$((i + 1)); done)"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user