|
|
|
@ -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
|
|
|
|
|