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?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Mathias Kőrber <mathias@koerber.org>
Newsgroups comp.sys.mac.system
Subject Re: /etc/ppp/ip-up: how to distinguish service?
Date Mon, 18 Aug 2014 20:44:01 +0800
Lines 22
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>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace individual.net NZqP+zza4vXzt1KpZDkxdwvP6teoNBXqSvVVE+OjdLHJw85/k=
Cancel-Lock sha1:J/XKlWlnG+1dbGGPWJ2AvxfCtwU=
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <lssc4v$eag$1@dont-email.me>
OpenPGP id=78D0B871
Xref csiph.com comp.sys.mac.system:63352

Show key headers only | 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 | Unroll thread


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