I am trying to get this script to run in Ubuntu 20.04.
I placed it in /usr/local/bin$, /etc/init.d$,
#!/bin/sh
### BEGIN INIT INFO
# Provides: 1000Mbs
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Halts USB power...
### END INIT INFO
ETHTOOL="/usr/sbin/ethtool"
DEV="ens32"
SPEED="1000 duplex full"
RXBUFFERS="4096"
TXBUFFERS="4096"
NEG="off"
case "$1" in
start)
echo -n "Setting ens32 speed 1000 duplex full autoneg off...";
$ETHTOOL -s $DEV speed $SPEED autoneg $NEG;
echo -n "Setting ens32 rx 4096 tx 4096...";
$ETHTOOL -G $DEV rx $RXBUFFERS tx $TXBUFFERS;
echo " done.";;
stop)
;;
esac
exit 0
here is /etc/systemd/system/1000Mbs.service
[Unit]
After=network.service
[Service]
ExecStart=/usr/local/bin/1000Mbs.sh
[Install]
WantedBy=default.target
I
rx and tx don't set. sudo /etc/init.d/1000Mbs does work but not on restart in Ubuntu 20.04.