Skip to content

Instantly share code, notes, and snippets.

@neggles
Last active December 14, 2022 23:26
Show Gist options
  • Save neggles/285d7fe45e9fd7488fb955af2f802138 to your computer and use it in GitHub Desktop.
Save neggles/285d7fe45e9fd7488fb955af2f802138 to your computer and use it in GitHub Desktop.
systemd unit to disable EEE on interfaces at startup
[Unit]
Description=Disable EEE on %i on startup
Wants=network.target network-online.target
After=network-online.target
[Service]
Type=simple
RemainAfterExit=true
# Uncomment the below to do a slightly hacky check for whether the link is up.
#ExecStartPre=/bin/bash -c '[ $(cat /sys/class/net/%i/carrier) == "1" ]'
ExecStart=/sbin/ethtool --set-eee %i eee off
# If we get an unclean exit code, retry
Restart=on-failure
# Wait 30s before retrying
RestartSec=30s
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment