messages.go 512 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. "runtime"
  5. )
  6. // ReloadMessage returns a description of the task required to reload
  7. // the crowdsec configuration, according to the operating system.
  8. func ReloadMessage() string {
  9. var msg string
  10. switch runtime.GOOS {
  11. case "windows":
  12. msg = "Please restart the crowdsec service"
  13. case "freebsd":
  14. msg = `Run 'sudo service crowdsec reload'`
  15. default:
  16. msg = `Run 'sudo systemctl reload crowdsec'`
  17. }
  18. return fmt.Sprintf("%s for the new configuration to be effective.", msg)
  19. }