2021-03-26 16:42:56 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
ReloadMessageFormat = `Run '%s' for the new configuration to be effective.`
|
|
|
|
ReloadCmdLinux = `sudo systemctl reload crowdsec`
|
|
|
|
ReloadCmdFreebsd = `sudo service crowdsec reload`
|
|
|
|
)
|
|
|
|
|
|
|
|
func ReloadMessage() string {
|
|
|
|
|
|
|
|
var reloadCmd string
|
|
|
|
|
2022-05-17 10:14:59 +00:00
|
|
|
switch runtime.GOOS {
|
|
|
|
case "windows":
|
|
|
|
return "Please restart the crowdsec service for the new configuration to be effective."
|
|
|
|
case "freebsd":
|
2021-03-26 16:42:56 +00:00
|
|
|
reloadCmd = ReloadCmdFreebsd
|
2022-05-17 10:14:59 +00:00
|
|
|
default:
|
2021-03-26 16:42:56 +00:00
|
|
|
reloadCmd = ReloadCmdLinux
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(ReloadMessageFormat, reloadCmd)
|
|
|
|
}
|