Ethtoolのバージョン違いバイナリが欲しい

以下を流すと、3.x.xから6.5が全部コンパイルされてbinに入ります。

#!/bin/sh -x
# curl https://cdn.kernel.org/pub/software/network/ethtool/ | grep "a href" | grep "tar.gz" | egrep "(tool-4|tool-5|tool-6|tool-3)" | cut -d '>' -f 3- | cut -d '<' -f 1
basepath="https://cdn.kernel.org/pub/software/network/ethtool/"
versions="ethtool-6.5.tar.gz
ethtool-6.4.tar.gz
ethtool-6.3.tar.gz
ethtool-6.2.tar.gz
ethtool-6.1.tar.gz
ethtool-6.0.tar.gz
ethtool-5.19.tar.gz
ethtool-5.18.tar.gz
ethtool-5.17.tar.gz
ethtool-5.16.tar.gz
ethtool-5.15.tar.gz
ethtool-5.14.tar.gz
ethtool-5.13.tar.gz
ethtool-5.12.tar.gz
ethtool-5.10.tar.gz
ethtool-5.9.tar.gz
ethtool-5.8.tar.gz
ethtool-5.7.tar.gz
ethtool-5.6.tar.gz
ethtool-5.4.tar.gz
ethtool-5.3.tar.gz
ethtool-5.2.tar.gz
ethtool-5.1.tar.gz
ethtool-5.0.tar.gz
ethtool-4.19.tar.gz
ethtool-4.18.tar.gz
ethtool-4.17.tar.gz
ethtool-4.16.tar.gz
ethtool-4.15.tar.gz
ethtool-4.13.tar.gz
ethtool-4.11.tar.gz
ethtool-4.10.tar.gz
ethtool-4.8.tar.gz
ethtool-4.6.tar.gz
ethtool-4.5.tar.gz
ethtool-4.2.tar.gz
ethtool-4.0.tar.gz
ethtool-3.18.tar.gz
ethtool-3.16.tar.gz
ethtool-3.15.tar.gz
ethtool-3.14.tar.gz
ethtool-3.13.tar.gz
ethtool-3.12.1.tar.gz
ethtool-3.12.tar.gz
ethtool-3.11.tar.gz
ethtool-3.10.tar.gz
ethtool-3.9.tar.gz
ethtool-3.8.tar.gz
ethtool-3.7.tar.gz
ethtool-3.6.tar.gz
ethtool-3.5.tar.gz
ethtool-3.4.2.tar.gz
ethtool-3.4.1.tar.gz
ethtool-3.4.tar.gz
ethtool-3.2.tar.gz
ethtool-3.1.tar.gz
ethtool-3.0.tar.gz"

sudo  apt install libmnl-dev

for ver in $versions; do
 dlpath=$basepath$ver
 echo -n $ver...
 if test ! -f $ver; then
    echo LOADING
    curl $dlpath -so $ver
 else
     echo CACHE
 fi
done

for ver in $versions; do
 tar zxf $ver
done

mkdir src

targetdir=`find . -type d | grep ethtool`
echo $targetdir
for target in $targetdir; do
 cd $target
 ./configure
 make
 cp ethtool ../bin/$target
 cd ..

done

# for et in `ls ethtool*`; do echo ------$et ; sudo ./$et -m enp1s0f0np0 | head -n 20;sleep 1;  done

どうなるの?

ubuntu@optiplex:~/ethtool/bin$ ls
ethtool-3.0   ethtool-3.12    ethtool-3.16  ethtool-3.4.1  ethtool-3.7   ethtool-4.11  ethtool-4.17  ethtool-4.5  ethtool-5.1   ethtool-5.14  ethtool-5.18  ethtool-5.4  ethtool-5.9  ethtool-6.3
ethtool-3.1   ethtool-3.12.1  ethtool-3.18  ethtool-3.4.2  ethtool-3.9   ethtool-4.13  ethtool-4.18  ethtool-4.6  ethtool-5.10  ethtool-5.15  ethtool-5.19  ethtool-5.6  ethtool-6.0  ethtool-6.4
ethtool-3.10  ethtool-3.14    ethtool-3.2   ethtool-3.5    ethtool-4.0   ethtool-4.15  ethtool-4.19  ethtool-4.8  ethtool-5.12  ethtool-5.16  ethtool-5.2   ethtool-5.7  ethtool-6.1  ethtool-6.5
ethtool-3.11  ethtool-3.15    ethtool-3.4   ethtool-3.6    ethtool-4.10  ethtool-4.16  ethtool-4.2   ethtool-5.0  ethtool-5.13  ethtool-5.17  ethtool-5.3   ethtool-5.8  ethtool-6.2

全バージョン使い放題です!

お好きなように。

for et in `ls ethtool*`; do echo ------$et ; sudo ./$et --version | head -n 20;sleep 1;  done
------ethtool-3.0
ethtool version 3.0
------ethtool-3.1
ethtool version 3.1
------ethtool-3.10
ethtool version 3.10
------ethtool-3.11
ethtool version 3.11
------ethtool-3.12
ethtool version 3.12
------ethtool-3.12.1
ethtool version 3.12.1
------ethtool-3.14
ethtool version 5.1
------ethtool-3.15
ethtool version 3.15
...