Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #63352

Re: /etc/ppp/ip-up: how to distinguish service?

From Mathias Kőrber <mathias@koerber.org>
Newsgroups comp.sys.mac.system
Subject Re: /etc/ppp/ip-up: how to distinguish service?
Date 2014-08-18 20:44 +0800
Message-ID <c5eaohFem7aU1@mid.individual.net> (permalink)
References <c4iumrFnfv8U1@mid.individual.net> <lsd1m8$vgi$1@dont-email.me> <c50skhFkk7oU1@mid.individual.net> <lssc4v$eag$1@dont-email.me>

Show all headers | View raw


> I have one Location where I want to route everything over the VPN, 
> another where I don't.  I check which Location is active in ip-up:
> 
>          location=`/usr/sbin/scselect 2>&1 | /usr/bin/grep '^ \* ' |\
>                  /usr/bin/sed -e 's/^.*(//' -e 's/).*$//'`

Thanks. That might work but requires me to change the location, which
I have other things tied to..

I just found that one do what I want in AppleScript:

#!/usr/bin/osascript
tell application "System Events"
    tell current location of network preferences
        get name of every service whose (kind is equal 12) and connected
of current configuration is true
    end tell
end tell

which can then be called from /etc/ppp/ip-up

Back to comp.sys.mac.system | Previous | NextPrevious in thread | Find similar


Thread

/etc/ppp/ip-up: how to distinguish service? Mathias Kőrber <mathias@koerber.org> - 2014-08-08 11:32 +0800
  Re: /etc/ppp/ip-up: how to distinguish service? David Sankey <David.Sankey@stfc.ac.uk> - 2014-08-12 13:35 +0100
    Re: /etc/ppp/ip-up: how to distinguish service? Mathias Kőrber <mathias@koerber.org> - 2014-08-13 18:23 +0800
      Re: /etc/ppp/ip-up: how to distinguish service? David Sankey <David.Sankey@stfc.ac.uk> - 2014-08-18 09:05 +0100
        Re: /etc/ppp/ip-up: how to distinguish service? Mathias Kőrber <mathias@koerber.org> - 2014-08-18 20:44 +0800

csiph-web