mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-02-26 14:59:38 +08:00
ethtool_path修复
This commit is contained in:
parent
695fb81893
commit
92e0095cf0
1 changed files with 3 additions and 2 deletions
|
@ -624,6 +624,7 @@ install_package ipcalc
|
||||||
install_package dmidecode
|
install_package dmidecode
|
||||||
install_package dnsutils
|
install_package dnsutils
|
||||||
install_package ethtool
|
install_package ethtool
|
||||||
|
ethtool_path=$(which ethtool)
|
||||||
check_haveged
|
check_haveged
|
||||||
|
|
||||||
# 检测系统信息
|
# 检测系统信息
|
||||||
|
@ -987,9 +988,9 @@ fix_interfaces_ipv6_auto_type
|
||||||
# 特殊处理Hetzner和Azure的情况
|
# 特殊处理Hetzner和Azure的情况
|
||||||
if [[ $dmidecode_output == *"Hetzner_vServer"* ]] || [[ $dmidecode_output == *"Microsoft Corporation"* ]]; then
|
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)
|
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
|
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
|
chattr +i /etc/network/interfaces
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue