Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

goodthymes

macrumors member
Original poster
Oct 11, 2022
67
126
I have an M1 Mini and it doess not play nice with airplay to Homepods. The Mini is on an ethernet connection and about 50% of the time it is not able to talk to 2 different homepods unless the connection is reset; either by manually removing the cable and plugging back in or using the terminal command "sudo ifconfig". Once reset it's able to connect to the homepods immediately. It's only airplay that's the issue, all other network functions like browsing, printing to wireless printer, connecting to a Timecapsule is 100% uptime. I've done a clean install of Ventura and Sonoma and the problem presist so I'm incline to think it's just an M1 issue.

Is it possible to make a script that sits on the desktop that I can just double click to disable and then enable the ethernet interface? I looked through the new Shortcut app but didn't see suited for the purpose. The script is very simple, something like this:

sudo ifconfig en0 down
(password)
sudo ifconfig en0 up

Thanks in advance for any help!
 

DaveFromCampbelltown

macrumors 68000
Jun 24, 2020
1,577
2,569
Can't you do it via Network and Locations?
I have a "Default" automatic location that connects via DHCP, a "Normal" location that has the IP address and DNS servers defined, and a "None" location that has every thing turned off.
Once you have more than one location defined, you can just select it from the Apple Menu on the top left.
 

bogdanw

macrumors 603
Mar 10, 2009
5,735
2,765
sudo ifconfig en0 down
(password)
sudo ifconfig en0 up
networksetup doesn't require sudo.
AppleScript that can be saved as an app
AppleScript:
do shell script "networksetup -setnetworkserviceenabled Ethernet off"
delay 5
do shell script "networksetup -setnetworkserviceenabled Ethernet on"
 
  • Like
Reactions: fp99

goodthymes

macrumors member
Original poster
Oct 11, 2022
67
126
networksetup doesn't require sudo.
AppleScript that can be saved as an app
AppleScript:
do shell script "networksetup -setnetworkserviceenabled Ethernet off"
delay 5
do shell script "networksetup -setnetworkserviceenabled Ethernet on"
Thanks so much, I'll give it try.
 

goodthymes

macrumors member
Original poster
Oct 11, 2022
67
126
Can't you do it via Network and Locations?
I have a "Default" automatic location that connects via DHCP, a "Normal" location that has the IP address and DNS servers defined, and a "None" location that has every thing turned off.
Once you have more than one location defined, you can just select it from the Apple Menu on the top left.
Thank you, I'll give this option a try if the Apple script one doesn't work =)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.