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: =?UTF-8?B?TWF0aGlhcyBLxZFyYmVy?= 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: References: 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: OpenPGP: id=78D0B871 Xref: csiph.com comp.sys.mac.system:63352 > 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