Git Product home page Git Product logo

osx-netselect's Introduction

osx-netselect

Switch network profiles on OSX from terminal. Support for custom setup/teardown scripts.

[me@foo]$ netselect w

Switching network profile: Home -> Work
Password:
CurrentSet updated to 76809B31-F2D0-4872-A473-C0738AD282D2 (Work)
Added work route.

[me@foo]$ netselect h

Switching network profile: Work -> Home
Password:
CurrentSet updated to D28AC42A-7661-4FE1-B49F-63DA19FABF19 (Home)
Removed work route.

setup

  • Copy netselect to somewhere in your path.
  • Create folders for up and down scripts.
mkdir ~/.network/{up.d,down.d}
  • Up and down script names must match the network profile name.
  • See example how to set and remote a custom route.
  • Up and down scripts are executed with root permissions using sudo

usage

Available profiles

Let's say the following profiles are available:

[me@foo]$ scselect
Defined sets include: (* == current set)
   D28AC42A-7661-4FE1-B49F-63DA19FABF19	(Home)
   BDBFA23C-D3B9-4E43-9A18-C75C33259217	(Automatic)
 * 7C1E23D1-AB04-4C82-B0C1-05F1262BEAC6	(Home2)

Pick a profile

A matches profile name Automatic:

[me@foo]$ netselect a
Switching network profile: Home2 -> Automatic

home matches Home exactly:

[me@foo]$ netselect home
Switching network profile: Home2 -> Home

Errors

Ambigous selection: ho matches Home and Home2:

[me@foo]$ netselect ho
ERROR: Multiple profiles(#2) start with 'ho'.
-> Profile name must start with or equal pattern (case-inensitive).
-------------------------------------------------------------------
Defined sets include: (* == current set)
   D28AC42A-7661-4FE1-B49F-63DA19FABF19	(Home)
   BDBFA23C-D3B9-4E43-9A18-C75C33259217	(Automatic)
 * 7C1E23D1-AB04-4C82-B0C1-05F1262BEAC6	(Home2)

TODO

  • add bash completion for profile names

osx-netselect's People

Contributors

r10r avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

mikalv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.