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