ctwatch: allow state dir to be set by $CTWATCH_STATE_DIR
This commit is contained in:
parent
f988d05b4b
commit
5ccf9fdcd3
|
@ -12,7 +12,15 @@ import (
|
|||
"src.agwa.name/ctwatch/cmd"
|
||||
)
|
||||
|
||||
var stateDir = flag.String("state_dir", cmd.DefaultStateDir("ctwatch"), "Directory for storing state")
|
||||
func DefaultStateDir () string {
|
||||
if envVar := os.Getenv("CTWATCH_STATE_DIR"); envVar != "" {
|
||||
return envVar
|
||||
} else {
|
||||
return cmd.DefaultStateDir("ctwatch")
|
||||
}
|
||||
}
|
||||
|
||||
var stateDir = flag.String("state_dir", DefaultStateDir(), "Directory for storing state")
|
||||
var watchDomains []string
|
||||
var watchDomainSuffixes []string
|
||||
|
||||
|
|
Loading…
Reference in New Issue