1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-25 07:41:30 +00:00

Fix generate_config.sh termination when user declines IPv6 Docker configuration

Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-10 08:22:23 +00:00
parent 70affa0f69
commit 8f58ba8bc8

View File

@@ -139,9 +139,9 @@ docker_daemon_edit(){
exit 1 exit 1
fi fi
else else
echo -e "${YELLOW}User declined Docker update please insert these changes manually:${NC}" echo -e "${YELLOW}User declined Docker update skipping Docker daemon configuration.${NC}"
echo "${MISSING[*]}" echo -e "${YELLOW}IPv6 will be disabled for mailcow.${NC}"
exit 1 return 1
fi fi
fi fi
@@ -185,9 +185,9 @@ EOF
(command -v systemctl &>/dev/null && systemctl restart docker) || service docker restart (command -v systemctl &>/dev/null && systemctl restart docker) || service docker restart
echo "Docker restarted." echo "Docker restarted."
else else
echo "User declined to create daemon.json please manually merge the docker daemon with these configs:" echo -e "${YELLOW}User declined to create daemon.json skipping Docker daemon configuration.${NC}"
echo "${MISSING[*]}" echo -e "${YELLOW}IPv6 will be disabled for mailcow.${NC}"
exit 1 return 1
fi fi
fi fi
} }
@@ -223,7 +223,20 @@ configure_ipv6() {
return return
fi fi
docker_daemon_edit if ! docker_daemon_edit; then
# User declined Docker daemon configuration
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then
if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
sed -i 's/^ENABLE_IPV6=.*/ENABLE_IPV6=false/' "$MAILCOW_CONF"
else
echo "ENABLE_IPV6=false" >> "$MAILCOW_CONF"
fi
else
export IPV6_BOOL=false
fi
echo "IPv6 configuration complete: ENABLE_IPV6=false"
return 0
fi
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then
if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then