mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 14:57:16 +08:00
refactor: 重构 tools.Read 函数
This commit is contained in:
@@ -342,7 +342,10 @@ func (r *SafeController) GetPingStatus(ctx http.Context) http.Response {
|
||||
return Success(ctx, false)
|
||||
}
|
||||
} else {
|
||||
config := tools.Read("/etc/ufw/before.rules")
|
||||
config, err := tools.Read("/etc/ufw/before.rules")
|
||||
if err != nil {
|
||||
return Error(ctx, http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
if strings.Contains(config, "-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT") {
|
||||
return Success(ctx, true)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user