From 92e0095cf00a2e241d86fa5a6fdc355952552422 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 31 Jul 2023 22:18:11 +0800 Subject: [PATCH] =?UTF-8?q?ethtool=5Fpath=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_pve.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 638234c..f5be420 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -624,6 +624,7 @@ install_package ipcalc install_package dmidecode install_package dnsutils install_package ethtool +ethtool_path=$(which ethtool) check_haveged # 检测系统信息 @@ -987,9 +988,9 @@ fix_interfaces_ipv6_auto_type # 特殊处理Hetzner和Azure的情况 if [[ $dmidecode_output == *"Hetzner_vServer"* ]] || [[ $dmidecode_output == *"Microsoft Corporation"* ]]; then auto_interface=$(grep '^auto ' /etc/network/interfaces | grep -v '^auto lo' | awk '{print $2}' | head -n 1) - if ! grep -q "^post-up /sbin/ethtool" /etc/network/interfaces; then + if ! grep -q "^post-up ${$ethtool_path}" /etc/network/interfaces; then chattr -i /etc/network/interfaces - echo "post-up /sbin/ethtool -K $auto_interface tx off rx off" >> /etc/network/interfaces + echo "post-up ${$ethtool_path} -K $auto_interface tx off rx off" >> /etc/network/interfaces chattr +i /etc/network/interfaces fi fi