Skip to content

Commit

Permalink
Provide flag to overwrite port number
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed May 18, 2024
1 parent 47f0932 commit 645f214
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ func info() string {
func main() {
var config string
flag.StringVar(&config, "config", "", "configuration file")
var port int
flag.IntVar(&port, "port", 0, "server port number")
var useX509 bool
flag.BoolVar(&useX509, "useX509", false, "start X509 auth server")
var scitokens bool
Expand Down Expand Up @@ -361,6 +363,10 @@ func main() {
logging.CMSMonitType = Config.MonitType
logging.CMSMonitProducer = Config.MonitProducer

if port > 0 {
log.Println("overwrite server port number to", port)
Config.Port = port
}
if Config.Verbose > 0 {
log.Printf("%+v\n", Config)
}
Expand Down

0 comments on commit 645f214

Please sign in to comment.