Created
February 6, 2020 20:11
-
-
Save henri/e007b44a964989025bd81c2bb722d0cd to your computer and use it in GitHub Desktop.
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
# This lines below are able to be placed into a script and then used to allow switching a system to a specific network interface at a specific time | |
# If you are looking to have this as an alias then visit this page : http://henri.shustak.org/github/handy-alias/ | |
# | |
priority_interface_name="name_of_interface_to_prioritize" | |
echo sudo /usr/sbin/networksetup -ordernetworkservices \\\"${priority_interface_name}\\\" `/usr/sbin/networksetup -listallnetworkservices | grep -v 'An asterisk ' | sed s/\^'*'// | grep -xv "${priority_interface_name}" | sed 's/.*/\"&\"/' | tr '\n' ' ' | sed 's/.$//' | sed 's/\"/\\\\\"/g'` | tr -d "\\" | bash | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment