20ccb32124
* FreeBSD changes (#718) * Update build Makefile to be able to build on other platforms Split Makefiles to isolate every specifics per platform if specific file is not found, the include will default to linux. * Isolate linux specific messages emitted by crowdsec command line On other platforms, we shouldn't write messages with `systemctl` occurrences. This commit isolate the specific messages and ensure the messages are relevant for the given platform according result of `GOOS`. * remove the test Co-authored-by: Sofian Brabez <sbz@6dev.net> Co-authored-by: AlteredCoder <AlteredCoder>
25 lines
456 B
Go
25 lines
456 B
Go
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
|
|
|
|
if runtime.GOOS == "freebsd" {
|
|
reloadCmd = ReloadCmdFreebsd
|
|
} else {
|
|
reloadCmd = ReloadCmdLinux
|
|
}
|
|
|
|
return fmt.Sprintf(ReloadMessageFormat, reloadCmd)
|
|
}
|