fix: config.yaml path

This commit is contained in:
zhangsz
2025-03-07 10:31:15 +08:00
parent af262f265f
commit 6ed53865c3

View File

@@ -105,7 +105,7 @@ type DbConfig struct {
var Config = DbConfig{ /*mysql: "192.168.1.151:3306", username: "root", password: "rootaa"*/}
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
} else {
if yamlErr := yaml.Unmarshal(content, &Config); yamlErr != nil {
@@ -120,7 +120,7 @@ func SavePcfCfg() {
if content, err := yaml.Marshal(&Config); err != nil {
l4g.CfgLog.Errorf("Marshal failed error %s", err.Error())
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())
return
}