mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 修改 UFW 防火墙重启方式 (#3402)
This commit is contained in:
parent
733889407e
commit
411402f9cb
@ -65,9 +65,11 @@ func (f *Ufw) Stop() error {
|
||||
}
|
||||
|
||||
func (f *Ufw) Restart() error {
|
||||
stdout, err := cmd.Execf("%s systemctl restart ufw.service", cmd.SudoHandleCmd())
|
||||
if err != nil {
|
||||
return fmt.Errorf("restart the firewall failed, err: %s", stdout)
|
||||
if err := f.Stop(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := f.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user