From 87f94af11323cd9d5333b5265214e617d784c231 Mon Sep 17 00:00:00 2001 From: small_5 <30542017+small-5@users.noreply.github.com> Date: Wed, 25 Dec 2019 09:12:34 +0800 Subject: [PATCH] Update autocore (#2571) --- package/lean/autocore/files/autocore | 37 +++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/package/lean/autocore/files/autocore b/package/lean/autocore/files/autocore index 501b31e50..f372db0a6 100755 --- a/package/lean/autocore/files/autocore +++ b/package/lean/autocore/files/autocore @@ -35,29 +35,20 @@ start() mkdir -p /tmp/sysinfo echo $g > /tmp/sysinfo/model - ethtool -K eth0 rx-checksum on >/dev/null 2>&1 - ethtool -K eth0 tx-checksum-ip-generic on >/dev/null 2>&1 - ethtool -K eth0 tso on >/dev/null 2>&1 - ethtool -K eth0 ufo on >/dev/null 2>&1 - ethtool -K eth0 gso on >/dev/null 2>&1 - - ethtool -K eth1 rx-checksum on >/dev/null 2>&1 - ethtool -K eth1 tx-checksum-ip-generic on >/dev/null 2>&1 - ethtool -K eth1 tso on >/dev/null 2>&1 - ethtool -K eth1 ufo on >/dev/null 2>&1 - ethtool -K eth1 gso on >/dev/null 2>&1 - - ethtool -K eth2 rx-checksum on >/dev/null 2>&1 - ethtool -K eth2 tx-checksum-ip-generic on >/dev/null 2>&1 - ethtool -K eth2 tso on >/dev/null 2>&1 - ethtool -K eth2 ufo on >/dev/null 2>&1 - ethtool -K eth2 gso on >/dev/null 2>&1 - - ethtool -K eth3 rx-checksum on >/dev/null 2>&1 - ethtool -K eth3 tx-checksum-ip-generic on >/dev/null 2>&1 - ethtool -K eth3 tso on >/dev/null 2>&1 - ethtool -K eth3 ufo on >/dev/null 2>&1 - ethtool -K eth3 gso on >/dev/null 2>&1 + a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.") + b=$(echo "$a" | wc -l) + for i in $(seq 1 $b) + do + c=$(echo "$a" | sed -n ${i}p) + ethtool -K $c rx-checksum on >/dev/null 2>&1 + ethtool -K $c tx-checksum-ip-generic on >/dev/null 2>&1 || ( + ethtool -K $c tx-checksum-ipv4 on >/dev/null 2>&1 + ethtool -K $c tx-checksum-ipv6 on >/dev/null 2>&1) + ethtool -K $c tx-scatter-gather on >/dev/null 2>&1 + ethtool -K $c gso on >/dev/null 2>&1 + ethtool -K $c tso on >/dev/null 2>&1 + ethtool -K $c ufo on >/dev/null 2>&1 + done [ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm }