mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 11:09:16 +08:00
parent
cd5658adab
commit
262ddb5f12
@ -183,6 +183,13 @@ func (f *Ufw) RichRules(rule FireInfo, operation string) error {
|
||||
|
||||
stdout, err := cmd.Exec(ruleStr)
|
||||
if err != nil {
|
||||
if strings.Contains(stdout, "ERROR: Invalid position") {
|
||||
stdout, err := cmd.Exec(strings.ReplaceAll(ruleStr, "insert 1 ", ""))
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s rich rules (%s), failed, err: %s", operation, ruleStr, stdout)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("%s rich rules (%s), failed, err: %s", operation, ruleStr, stdout)
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user