mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/1Panel-dev/1Panel.git
synced 2026-09-20 08:03:55 +08:00
fix: Fix the issue of abnormal ufw status loading (#10949)
This commit is contained in:
@@ -59,21 +59,15 @@ func (u *FirewallService) LoadBaseInfo(tab string) (dto.FirewallBaseInfo, error)
|
||||
baseInfo.Name = client.Name()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(4)
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
baseInfo.PingStatus = u.pingStatus()
|
||||
}()
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
baseInfo.IsActive, _ = client.Status()
|
||||
}()
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
baseInfo.Version, _ = client.Version()
|
||||
}()
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
baseInfo.IsActive, _ = client.Status()
|
||||
baseInfo.IsInit, baseInfo.IsBind = loadInitStatus(baseInfo.Name, tab)
|
||||
}()
|
||||
wg.Wait()
|
||||
|
||||
@@ -97,7 +97,7 @@ func CheckChainExist(tab, chain string) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
func CheckChainBind(tab, parentChain, chain string) (bool, error) {
|
||||
stdout, err := RunWithStd(tab, fmt.Sprintf("-L %s | grep -w %s", parentChain, chain))
|
||||
stdout, err := RunWithStd(tab, fmt.Sprintf("-S %s | grep -- '-j %s'", parentChain, chain))
|
||||
if err != nil {
|
||||
global.LOG.Errorf("check chain %s from tab %s is bind to %s failed, err: %v", chain, tab, parentChain, err)
|
||||
return false, fmt.Errorf("check chain %s from tab %s is bind to %s failed, err: %v", chain, tab, parentChain, err)
|
||||
|
||||
Reference in New Issue
Block a user