fix: config.yaml path
This commit is contained in:
@@ -105,7 +105,7 @@ type DbConfig struct {
|
|||||||
var Config = DbConfig{ /*mysql: "192.168.1.151:3306", username: "root", password: "rootaa"*/}
|
var Config = DbConfig{ /*mysql: "192.168.1.151:3306", username: "root", password: "rootaa"*/}
|
||||||
|
|
||||||
func ReadConfig() error {
|
func ReadConfig() error {
|
||||||
if content, err := ioutil.ReadFile("/usr/local/etc/restproxy/config.yaml"); err != nil {
|
if content, err := ioutil.ReadFile("/usr/local/restproxy/etc/config.yaml"); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
if yamlErr := yaml.Unmarshal(content, &Config); yamlErr != nil {
|
if yamlErr := yaml.Unmarshal(content, &Config); yamlErr != nil {
|
||||||
@@ -120,7 +120,7 @@ func SavePcfCfg() {
|
|||||||
if content, err := yaml.Marshal(&Config); err != nil {
|
if content, err := yaml.Marshal(&Config); err != nil {
|
||||||
l4g.CfgLog.Errorf("Marshal failed error %s", err.Error())
|
l4g.CfgLog.Errorf("Marshal failed error %s", err.Error())
|
||||||
return
|
return
|
||||||
} else if fileErr := ioutil.WriteFile("/usr/local/etc/restproxy/config.yaml", content, 0644); fileErr != nil {
|
} else if fileErr := ioutil.WriteFile("/usr/local/restproxy/etc/config.yaml", content, 0644); fileErr != nil {
|
||||||
l4g.CfgLog.Errorf("WriteFile failed error %s", fileErr.Error())
|
l4g.CfgLog.Errorf("WriteFile failed error %s", fileErr.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user