fix: 解决中文插件下 ufw 防火墙获取端口列表失败的问题 (#746)

This commit is contained in:
ssongliu 2023-04-21 16:45:22 +08:00 committed by GitHub
parent 549ccbe6a0
commit 5222388ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ func (f *Ufw) ListPort() ([]FireInfo, error) {
var datas []FireInfo
isStart := false
for _, line := range portInfos {
if strings.HasPrefix(line, "--") {
if strings.HasPrefix(line, "-") {
isStart = true
continue
}
@ -100,7 +100,7 @@ func (f *Ufw) ListAddress() ([]FireInfo, error) {
var datas []FireInfo
isStart := false
for _, line := range portInfos {
if strings.HasPrefix(line, "--") {
if strings.HasPrefix(line, "-") {
isStart = true
continue
}