crowdsec/cmd/crowdsec-cli/messages.go

24 lines
512 B
Go
Raw Permalink Normal View History

package main
import (
"fmt"
"runtime"
)
// ReloadMessage returns a description of the task required to reload
// the crowdsec configuration, according to the operating system.
func ReloadMessage() string {
var msg string
2022-05-17 10:14:59 +00:00
switch runtime.GOOS {
case "windows":
msg = "Please restart the crowdsec service"
2022-05-17 10:14:59 +00:00
case "freebsd":
msg = `Run 'sudo service crowdsec reload'`
2022-05-17 10:14:59 +00:00
default:
msg = `Run 'sudo systemctl reload crowdsec'`
}
return fmt.Sprintf("%s for the new configuration to be effective.", msg)
}