Export: fix up export format

This commit is contained in:
Jason A. Donenfeld 2018-11-01 17:31:50 +01:00
parent 479f04a579
commit ae992c3deb
1 changed files with 11 additions and 13 deletions

View File

@ -22,10 +22,9 @@ class WgQuickConfigFileWriter {
if let mtu = interface.mtu {
output.append("MTU = \(mtu)\n")
}
output.append("\n")
for peer in tc.peers {
output.append("[Peer]\n")
output.append("\n[Peer]\n")
output.append("PublicKey = \(peer.publicKey.base64EncodedString())\n")
if let preSharedKey = peer.preSharedKey {
output.append("PresharedKey = \(preSharedKey.base64EncodedString())\n")
@ -40,7 +39,6 @@ class WgQuickConfigFileWriter {
if let persistentKeepAlive = peer.persistentKeepAlive {
output.append("PersistentKeepalive = \(persistentKeepAlive)\n")
}
output.append("\n")
}
return output.data(using: .utf8)