Last active
December 14, 2022 23:26
-
-
Save neggles/285d7fe45e9fd7488fb955af2f802138 to your computer and use it in GitHub Desktop.
systemd unit to disable EEE on interfaces at startup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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