Skip to content

Commit 8e3c5d6

Browse files
authored
Merge pull request #175 from githubnext/copilot/fix-grep-unrecognized-option
Fix BusyBox grep incompatibility in containerized host IP detection
2 parents db4003e + 701e2ef commit 8e3c5d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

run_containerized.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ configure_host_dns() {
243243
local HOST_IP=""
244244

245245
# Method 1: Try to get the primary network interface IP (not loopback)
246-
HOST_IP=$(ip -4 addr show 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '^127\.' | head -1)
246+
HOST_IP=$(ip -4 addr show 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | grep -v '^127\.' | head -1)
247247
if [ -n "$HOST_IP" ]; then
248248
log_info "Method 1 (primary interface): $HOST_IP"
249249
fi

0 commit comments

Comments
 (0)