2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 10:07:15 +08:00

fix(safe): ping status

This commit is contained in:
耗子
2023-07-27 15:14:45 +08:00
parent 9ffa32160b
commit 1cbd282e40

View File

@@ -221,8 +221,8 @@ func (r *SafeController) SetSshPort(ctx http.Context) {
func (r *SafeController) GetPingStatus(ctx http.Context) {
if tools.IsRHEL() {
out := tools.ExecShell(`firewall-cmd --query-rich-rule='rule protocol value=icmp drop'`)
if strings.Contains(out, "no") {
out := tools.ExecShell(`firewall-cmd --list-all 2>&1`)
if !strings.Contains(out, `rule protocol value="icmp" drop`) {
Success(ctx, true)
} else {
Success(ctx, false)