Bug Fix: Remove ipv6 binding from nginx config if ipv6 is not available.

This commit is contained in:
SergeantPanda 2025-12-08 20:12:44 -06:00
parent 4df4e5f963
commit 69f9ecd93c
2 changed files with 13 additions and 1 deletions

View file

@ -29,9 +29,17 @@ if [ "$(id -u)" = "0" ] && [ -d "/app" ]; then
chown $PUID:$PGID /app
fi
fi
# Configure nginx port
sed -i "s/NGINX_PORT/${DISPATCHARR_PORT}/g" /etc/nginx/sites-enabled/default
# Configure nginx based on IPv6 availability
if ip -6 addr show | grep -q "inet6"; then
echo "✅ IPv6 is available, enabling IPv6 in nginx"
else
echo "⚠️ IPv6 not available, disabling IPv6 in nginx"
sed -i '/listen \[::\]:/d' /etc/nginx/sites-enabled/default
fi
# NOTE: mac doesn't run as root, so only manage permissions
# if this script is running as root
if [ "$(id -u)" = "0" ]; then