surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
Add error handling for grep when no Docker DNS rules exist, preventing script failure on default Docker networks while still preserving DNS functionality on custom networks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
| @@ -3,7 +3,7 @@ | ||
| 3 | 3 | IFS=$'\n\t' # Stricter word splitting |
| 4 | 4 | |
| 5 | 5 | # 1. Extract Docker DNS info BEFORE any flushing |
| 6 | -DOCKER_DNS_RULES=$(iptables-save -t nat | grep "127\.0\.0\.11") | |
| 6 | +DOCKER_DNS_RULES=$(iptables-save -t nat | grep "127\.0\.0\.11" || true) | |
| 7 | 7 | |
| 8 | 8 | # Flush existing rules and delete existing ipsets |
| 9 | 9 | iptables -F |