Skip to content

isidorjokull/en0-Restart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Restart en0 at boot — for A&H MIDI Control / dLive fix

When M-chip Macs boot, sometimes the A&H Midi control cannot connect until the network device has been turned off and on again.

This LaunchDaemon cycles the en0 Ethernet interface at every boot, running as root so no sudo password is needed.

Install

# 1. Copy the script
sudo cp restart-en0.sh /usr/local/bin/restart-en0.sh
sudo chmod 755 /usr/local/bin/restart-en0.sh

# 2. Copy the plist
sudo cp com.local.restart-en0.plist /Library/LaunchDaemons/com.local.restart-en0.plist
sudo chown root:wheel /Library/LaunchDaemons/com.local.restart-en0.plist
sudo chmod 644 /Library/LaunchDaemons/com.local.restart-en0.plist

# 3. Load it (takes effect immediately + every future boot)
sudo launchctl load /Library/LaunchDaemons/com.local.restart-en0.plist

Verify it's running

sudo launchctl list | grep restart-en0

Check the log

cat /var/log/restart-en0.log

Uninstall

sudo launchctl unload /Library/LaunchDaemons/com.local.restart-en0.plist
sudo rm /Library/LaunchDaemons/com.local.restart-en0.plist
sudo rm /usr/local/bin/restart-en0.sh

Notes

  • This runs at boot (before login), not at login. That means en0 is already cycled by the time you sit down and open MIDI Control.
  • If you'd rather run it at login instead, move the plist to ~/Library/LaunchAgents/ — but then it runs as your user and you'd need a sudoers NOPASSWD entry for ifconfig.
  • The 5-second sleep between down/up gives the link time to fully drop. Increase it if your switch takes longer to re-negotiate.

About

When M-chip Macs boot, sometimes the A&H Midi control cannot connect until the network device has been turned off and on again. This LaunchDaemon cycles the `en0` Ethernet interface at every boot, running as root so no sudo password is needed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages