mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-19 06:53:14 +02:00
switch to toast instead of alert messages, implement serverIDs and restart tracking for every remote-server
This commit is contained in:
@@ -80,9 +80,18 @@ func ReloadFail2ban() error {
|
||||
return conn.Reload(context.Background())
|
||||
}
|
||||
|
||||
// RestartFail2ban restarts the Fail2ban service using the default connector.
|
||||
func RestartFail2ban() error {
|
||||
conn, err := GetManager().DefaultConnector()
|
||||
// RestartFail2ban restarts the Fail2ban service using the provided server or default connector.
|
||||
func RestartFail2ban(serverID string) error {
|
||||
manager := GetManager()
|
||||
var (
|
||||
conn Connector
|
||||
err error
|
||||
)
|
||||
if serverID != "" {
|
||||
conn, err = manager.Connector(serverID)
|
||||
} else {
|
||||
conn, err = manager.DefaultConnector()
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user