mirror of
https://github.com/go-i2p/go-i2cp.git
synced 2025-06-07 01:01:09 -04:00
make path to config configurable
This commit is contained in:
10
client.go
10
client.go
@ -136,11 +136,15 @@ func NewClient(callbacks *ClientCallBacks) (c *Client) {
|
||||
|
||||
func (c *Client) setDefaultProperties() {
|
||||
c.properties = defaultProperties
|
||||
home := os.Getenv("HOME")
|
||||
home := os.Getenv("I2CP_HOME")
|
||||
if len(home) == 0 {
|
||||
return
|
||||
home = ""
|
||||
}
|
||||
config := home + defaultConfigFile
|
||||
conf := os.Getenv("GO_I2CP_CONF")
|
||||
if len(conf) == 0 {
|
||||
conf = defaultConfigFile
|
||||
}
|
||||
config := home + conf
|
||||
Debug(CLIENT, "Loading config file %s", config)
|
||||
ParseConfig(config, c.SetProperty)
|
||||
}
|
||||
|
Reference in New Issue
Block a user