Skip to main content

Select a VPN profile (vpnconf.select)

Declaration​

ok = vpnconf.select(nameOrId)

Parameters​

  • nameOrId
    String. Display name or VPNID. If multiple profiles share the same name, selection is not deterministic. Use VPNID for precise selection.

Returns​

  • ok
    Boolean. true on success; false on failure (usually because the specified profile does not exist).

Description​

You can obtain VPNID via vpnconf.list.

Example​

local success = vpnconf.select('DemoVPN')
if success then
sys.alert('Operation succeeded')
else
sys.alert('Operation failed. Please verify the target VPN exists.')
end