This is a follow-up question of Start configured VPN from command line (OSX).
I tried the answer by @encoded, which suggests the following command:
scutil --nc start [A-name-of-VPN-configuration-stored-in-Network-Preferences]
It works nicely for PPTP connection, but for L2TP, this command fails to read the shared secret stored in that configuration, and I need to provide
--secret [shared-secret] for L2TP connection.
This is obviously not safe enough; I want
scutil to be aware of the secret stored instead of asking me. As it can read stored username and password, this should be only a small tweak, but I can't figure out what it is.
I'm running OS X Yosemite 10.10.3.