From 49d6920f447ed9827a5665f45d2998431e150ab7 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 4 May 2026 14:25:59 +0200 Subject: [PATCH] Use ip command to get container IP and suppress Docker service output The script now uses the ip command instead of hostname -i to reliably obtain the container's IPv4 address. Service command output is also redirected to /dev/null to reduce noise in the logs. --- gitea-runner/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gitea-runner/install.sh b/gitea-runner/install.sh index f8f78cd..9545f42 100644 --- a/gitea-runner/install.sh +++ b/gitea-runner/install.sh @@ -105,7 +105,7 @@ create_lxc() { curl -fsSL "$SCRIPT_URL" | pct exec "$CTID" -- bash -s -- --install local ip - ip=$(pct exec "$CTID" -- hostname -i 2>/dev/null | awk '{print $1}') + local ip\n ip=$(pct exec \"$CTID\" -- ip -4 addr show eth0 2>/dev/null | awk '/inet /{print $2}' | cut -d/ -f1) echo "" log_info "=========================================" @@ -136,8 +136,8 @@ install_runner() { apk add --no-cache curl jq tar bash docker docker-cli-compose > /dev/null log_info "Starting Docker..." - rc-update add docker default > /dev/null - rc-service docker start + rc-update add docker default > /dev/null 2>&1 + rc-service docker start > /dev/null 2>&1 local release release=$(get_latest_release)