messages.go 456 B

12345678910111213141516171819202122232425
  1. package main
  2. import (
  3. "fmt"
  4. "runtime"
  5. )
  6. const (
  7. ReloadMessageFormat = `Run '%s' for the new configuration to be effective.`
  8. ReloadCmdLinux = `sudo systemctl reload crowdsec`
  9. ReloadCmdFreebsd = `sudo service crowdsec reload`
  10. )
  11. func ReloadMessage() string {
  12. var reloadCmd string
  13. if runtime.GOOS == "freebsd" {
  14. reloadCmd = ReloadCmdFreebsd
  15. } else {
  16. reloadCmd = ReloadCmdLinux
  17. }
  18. return fmt.Sprintf(ReloadMessageFormat, reloadCmd)
  19. }