fix: handle missing ip command in MTU setup
Update README Actions Table / update-readme (push) Successful in 3s

This commit is contained in:
2026-06-13 09:58:48 -07:00
parent 0a0511c27a
commit f3f0a8e4b1
+17 -6
View File
@@ -20,13 +20,24 @@ runs:
- name: Fix MTU size for Proxmox/Docker network compatibility - name: Fix MTU size for Proxmox/Docker network compatibility
shell: bash shell: bash
run: | run: |
DEFAULT_INTERFACE=$(ip route show | grep default | awk '{print $5}') if ! command -v ip &> /dev/null; then
if [ -n "$DEFAULT_INTERFACE" ]; then if command -v apt-get &> /dev/null && [ "$(id -u)" -eq 0 ]; then
echo "Setting MTU of $DEFAULT_INTERFACE to 1400..." echo "ip command not found. Installing iproute2..."
if [ "$(id -u)" -eq 0 ]; then apt-get update -qy && apt-get install -qy iproute2 || true
ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true
else 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
fi fi