Posted on 04-21-2015 07:48 AM
Hello,
I'd like to create a script to change the service order in network preferences to make Built In Ethernet and Thunderbolt Ethernet preferred over Wifi. We have had trouble with our wifi network getting overloaded and would like all 500 machines to prefer Ethernet, without requiring the user to do anything except plug their machine in using ethernet. I have been Googling/searching JAMF Nation for about an hour and have not come up with any successful solutions other than manually changing the service order in Network Preferences. Does anyone have any experience with networksetup -ordernetworkservices terminal commands or any other methods of completing this who could point me in the right direction?
Solved! Go to Solution.
Posted on 04-21-2015 11:34 AM
Thanks!
I found this which worked perfectly:
https://seanvanloon.wordpress.com/2015/02/17/script-to-set-the-service-priority-on-mac-os-x/
Posted on 04-21-2015 08:55 AM
There's quite a bit of useful information here:
https://jamfnation.jamfsoftware.com/discussion.html?id=11189
Posted on 04-21-2015 11:34 AM
Thanks!
I found this which worked perfectly:
https://seanvanloon.wordpress.com/2015/02/17/script-to-set-the-service-priority-on-mac-os-x/
Posted on 04-22-2015 08:29 AM
If you Just want to shutoff wifi when you have a working ethernet connection. Found this online a while back, forgot where, but kudos to the author. I run it as a outset login-every script
#!/bin/bash
PORT=$(ifconfig -a | grep autoselect | grep 100 | cut -c21-23)
if [ "${PORT:-0}" -eq 100 ] ; then
networksetup -setairportpower en1 off
else
exit 0
fi
LS