Created
June 11, 2021 18:31
-
-
Save melyux/b1a34262991e915f022dcd2461740ef0 to your computer and use it in GitHub Desktop.
Raspberry Pi - /etc/dhcpcd.enter-hook to disable Wi-Fi when Ethernet is plugged in and gets an IP address, and enable Wi-Fi on unplug
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
if [ "$reason" = "NOCARRIER" ] && [ "$interface" = "eth0" ]; then | |
rfkill unblock wifi | |
elif [ "$reason" = "BOUND" ] && [ "$interface" = "eth0" ]; then | |
rfkill block wifi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment