Add addresses, dns and mtu to export string.

This commit is contained in:
Jeroen Leenarts 2018-08-31 21:40:24 +02:00
parent 14e7391cce
commit fc70a92800
1 changed files with 11 additions and 2 deletions

View File

@ -60,10 +60,19 @@ extension Interface {
func export() -> String {
var exportString = "[Interface]\n"
if let privateKey = privateKey {
exportString.append("PrivateKey=\(privateKey)")
exportString.append("PrivateKey=\(privateKey)\n")
}
if let addresses = addresses {
exportString.append("Address=\(addresses)\n")
}
if let dns = dns {
exportString.append("DNS=\(dns)\n")
}
if mtu > 0 {
exportString.append("MTU=\(mtu)\n")
}
if listenPort > 0 {
exportString.append("ListenPort=\(listenPort)")
exportString.append("ListenPort=\(listenPort)\n")
}
exportString.append("\n")