support old getent implementation

master
Andy 6 years ago
parent 9229ff93e5
commit c17a7b98b6
Signed by: arno
GPG Key ID: 9076D5E6B31AE99C

@ -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…
Cancel
Save