2024-07-23 00:03:46 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## allow these addresses to be provided in case of:
|
|
|
|
## - local development/testing
|
|
|
|
## - `hostname -I' random failures or misbehavior
|
|
|
|
if [ -z "${NGX_IP_ADDRESSES:-}" ] ; then
|
|
|
|
NGX_IP_ADDRESSES=$(hostname -I)
|
|
|
|
fi
|
2024-07-26 01:18:59 +03:00
|
|
|
NGX_IP_ADDRESSES=$(normalize_list "${NGX_IP_ADDRESSES}")
|
2024-07-23 00:03:46 +03:00
|
|
|
export NGX_IP_ADDRESSES
|
|
|
|
|
|
|
|
unset NGX_IPV4_ADDRESSES NGX_IPV6_ADDRESSES
|
|
|
|
for i in ${NGX_IP_ADDRESSES} ; do
|
|
|
|
case "$i" in
|
|
|
|
*:* )
|
2024-07-26 01:18:59 +03:00
|
|
|
NGX_IPV6_ADDRESSES=$(append_list "${NGX_IPV6_ADDRESSES}" "$i")
|
2024-07-23 00:03:46 +03:00
|
|
|
;;
|
|
|
|
* )
|
2024-07-26 01:18:59 +03:00
|
|
|
NGX_IPV4_ADDRESSES=$(append_list "${NGX_IPV4_ADDRESSES}" "$i")
|
2024-07-23 00:03:46 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
unset i
|
|
|
|
|
|
|
|
export NGX_IPV4_ADDRESSES NGX_IPV6_ADDRESSES
|