799cc82bb5
* cmd/crowdsec: removed log.Fatal()s, added tests and print error for unrecognized argument * updated golangci-lint to v1.46 * lint/deadcode: fix existing issues * tests: cscli config backup/restore * tests: cscli completion powershell/fish * err check: pflags MarkHidden() * empty .dockerignore (and explain the reason) * tests, errors.Wrap * test for CS_LAPI_SECRET and minor refactoring * minor style changes * log cleanup
23 lines
512 B
Go
23 lines
512 B
Go
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
|
|
|
|
switch runtime.GOOS {
|
|
case "windows":
|
|
msg = "Please restart the crowdsec service"
|
|
case "freebsd":
|
|
msg = `Run 'sudo service crowdsec reload'`
|
|
default:
|
|
msg = `Run 'sudo systemctl reload crowdsec'`
|
|
}
|
|
|
|
return fmt.Sprintf("%s for the new configuration to be effective.", msg)
|
|
}
|