浏览代码

fix parsing postup/postdown

Matthew R. Kasun 3 年之前
父节点
当前提交
f42e40067a
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      logic/gateway.go
  2. 1 1
      netclient/wireguard/common.go

+ 1 - 1
logic/gateway.go

@@ -317,7 +317,7 @@ func firewallNFTCommandsCreateEgress(networkInterface string, gatewayInterface s
 		postUp += "nft add chain nat POSTROUTING ; "
 		postUp += "nft add rule ip nat POSTROUTING oifname " + gatewayInterface + " counter masquerade ; "
 
-		postDown += "nft flush table nat; "
+		postDown += "nft flush table nat ; "
 	}
 
 	return postUp, postDown

+ 1 - 1
netclient/wireguard/common.go

@@ -474,7 +474,7 @@ func UpdateWgInterface(file, privateKey, nameserver string, node models.Node) er
 		}
 	}
 	if node.PostDown != "" {
-		parts := strings.Split(node.PostDown, ";")
+		parts := strings.Split(node.PostDown, " ; ")
 		for i, part := range parts {
 			if i == 0 {
 				wireguard.Section(section_interface).Key("PostDown").SetValue(part)