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.
This commit is contained in:
Damien
2026-05-04 14:25:59 +02:00
parent ebc5547838
commit 49d6920f44

View File

@@ -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)