mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-10 20:05:55 +02:00
* don't ask user to reload systemd service when running in docker * refactor + give appropriate message if terminal is attached * remove explicit filetype
20 lines
374 B
Go
20 lines
374 B
Go
package reload
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/crowdsecurity/go-cs-lib/version"
|
|
isatty "github.com/mattn/go-isatty"
|
|
)
|
|
|
|
func UserMessage() string {
|
|
if version.System == "docker" {
|
|
if isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) {
|
|
return "You may need to restart the container to apply the changes."
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
return message
|
|
}
|