bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/cmd/synsec-cli/messages.go (about)

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