MacOS – how can /etc/ppp/ip-up tell which VPN service is used in OS X

macosvpn

I am using /etc/ppp/ip-up to set up some particular routes for an L2TP VN (defined in System Preferences/Network as a service)

I now want to add a new VPN service but use a different ip-up script (or at least have that ip-up script behave differently). I cannot see any distinguishing info that is passed to ip-up though. The parameters are the same, and the 'env' also does not contain a hint to the service name.
(in this case the second service is to the same VPN server, I just want a different set of routes set up depending on which VON I start, so going by the IP addresses ppp gets from remote is no use in this case)

is this even possible?

Best Answer

Taking a page from this answer: https://superuser.com/a/206826/48893 you can write an ip-up script that tests $1 and selectively execute commands for a given vpn interface.