Parse multiple "dhcp-option DOMAIN" lines
This commit is contained in:
parent
645f65ccd0
commit
4e77f5b6b3
@ -225,7 +225,7 @@ extension OpenVPN {
|
|||||||
var optRoutes4: [(String, String, String?)] = [] // address, netmask, gateway
|
var optRoutes4: [(String, String, String?)] = [] // address, netmask, gateway
|
||||||
var optRoutes6: [(String, UInt8, String?)] = [] // destination, prefix, gateway
|
var optRoutes6: [(String, UInt8, String?)] = [] // destination, prefix, gateway
|
||||||
var optDNSServers: [String]?
|
var optDNSServers: [String]?
|
||||||
var optSearchDomain: String?
|
var optSearchDomains: [String]?
|
||||||
var optHTTPProxy: Proxy?
|
var optHTTPProxy: Proxy?
|
||||||
var optHTTPSProxy: Proxy?
|
var optHTTPSProxy: Proxy?
|
||||||
var optProxyAutoConfigurationURL: URL?
|
var optProxyAutoConfigurationURL: URL?
|
||||||
@ -531,7 +531,10 @@ extension OpenVPN {
|
|||||||
guard $0.count == 2 else {
|
guard $0.count == 2 else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
optSearchDomain = $0[1]
|
if optSearchDomains == nil {
|
||||||
|
optSearchDomains = []
|
||||||
|
}
|
||||||
|
optSearchDomains?.append($0[1])
|
||||||
}
|
}
|
||||||
Regex.proxy.enumerateArguments(in: line) {
|
Regex.proxy.enumerateArguments(in: line) {
|
||||||
if $0.count == 2 {
|
if $0.count == 2 {
|
||||||
@ -738,7 +741,7 @@ extension OpenVPN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sessionBuilder.dnsServers = optDNSServers
|
sessionBuilder.dnsServers = optDNSServers
|
||||||
sessionBuilder.searchDomain = optSearchDomain
|
sessionBuilder.searchDomains = optSearchDomains
|
||||||
sessionBuilder.httpProxy = optHTTPProxy
|
sessionBuilder.httpProxy = optHTTPProxy
|
||||||
sessionBuilder.httpsProxy = optHTTPSProxy
|
sessionBuilder.httpsProxy = optHTTPSProxy
|
||||||
sessionBuilder.proxyAutoConfigurationURL = optProxyAutoConfigurationURL
|
sessionBuilder.proxyAutoConfigurationURL = optProxyAutoConfigurationURL
|
||||||
|
Loading…
Reference in New Issue
Block a user