From f3f0a8e4b101a7f69cea3b95a2292040704cd467 Mon Sep 17 00:00:00 2001 From: Rody Davis Date: Sat, 13 Jun 2026 09:58:48 -0700 Subject: [PATCH] fix: handle missing ip command in MTU setup --- setup-bazel/action.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/setup-bazel/action.yml b/setup-bazel/action.yml index ef48c1d..85c20c0 100644 --- a/setup-bazel/action.yml +++ b/setup-bazel/action.yml @@ -20,13 +20,24 @@ runs: - name: Fix MTU size for Proxmox/Docker network compatibility shell: bash run: | - DEFAULT_INTERFACE=$(ip route show | grep default | awk '{print $5}') - if [ -n "$DEFAULT_INTERFACE" ]; then - echo "Setting MTU of $DEFAULT_INTERFACE to 1400..." - if [ "$(id -u)" -eq 0 ]; then - ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true + if ! command -v ip &> /dev/null; then + if command -v apt-get &> /dev/null && [ "$(id -u)" -eq 0 ]; then + echo "ip command not found. Installing iproute2..." + apt-get update -qy && apt-get install -qy iproute2 || true else - sudo ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true + echo "ip command not found and cannot install. Skipping MTU configuration." + fi + fi + + if command -v ip &> /dev/null; then + DEFAULT_INTERFACE=$(ip route show | grep default | awk '{print $5}') + if [ -n "$DEFAULT_INTERFACE" ]; then + echo "Setting MTU of $DEFAULT_INTERFACE to 1400..." + if [ "$(id -u)" -eq 0 ]; then + ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true + else + sudo ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true + fi fi fi