fix: handle missing ip command in MTU setup
Update README Actions Table / update-readme (push) Successful in 3s
Update README Actions Table / update-readme (push) Successful in 3s
This commit is contained in:
+17
-6
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user