From a2ccb6c190acbd26de5d29d2c21bc53b39032ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=92=E9=87=8E=E7=84=A1=E7=87=88?= Date: Tue, 15 Jan 2019 23:41:06 +0800 Subject: [PATCH 1/2] frpc: fixup ini config parse problem in sub command `status` and `reload`. --- cmd/frpc/sub/reload.go | 9 ++++++++- cmd/frpc/sub/status.go | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/frpc/sub/reload.go b/cmd/frpc/sub/reload.go index 1e6f2c47..a05c3094 100644 --- a/cmd/frpc/sub/reload.go +++ b/cmd/frpc/sub/reload.go @@ -27,6 +27,7 @@ import ( "github.com/fatedier/frp/client" "github.com/fatedier/frp/g" + "github.com/fatedier/frp/models/config" ) func init() { @@ -37,7 +38,13 @@ var reloadCmd = &cobra.Command{ Use: "reload", Short: "Hot-Reload frpc configuration", RunE: func(cmd *cobra.Command, args []string) error { - err := parseClientCommonCfg(CfgFileTypeIni, cfgFile) + iniContent, err := config.GetRenderedConfFromFile(cfgFile) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + err = parseClientCommonCfg(CfgFileTypeIni, iniContent) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/cmd/frpc/sub/status.go b/cmd/frpc/sub/status.go index 3a25a4bc..883c7a7f 100644 --- a/cmd/frpc/sub/status.go +++ b/cmd/frpc/sub/status.go @@ -28,6 +28,7 @@ import ( "github.com/fatedier/frp/client" "github.com/fatedier/frp/g" + "github.com/fatedier/frp/models/config" ) func init() { @@ -38,7 +39,13 @@ var statusCmd = &cobra.Command{ Use: "status", Short: "Overview of all proxies status", RunE: func(cmd *cobra.Command, args []string) error { - err := parseClientCommonCfg(CfgFileTypeIni, cfgFile) + iniContent, err := config.GetRenderedConfFromFile(cfgFile) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + err = parseClientCommonCfg(CfgFileTypeIni, iniContent) if err != nil { fmt.Println(err) os.Exit(1) From 2061ef11c8b86a547ade717cb7e3a929cb13b2f7 Mon Sep 17 00:00:00 2001 From: fatedier Date: Wed, 16 Jan 2019 14:35:22 +0800 Subject: [PATCH 2/2] bump version to v0.23.1 --- utils/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/version/version.go b/utils/version/version.go index ce23fd25..1c5ddc27 100644 --- a/utils/version/version.go +++ b/utils/version/version.go @@ -19,7 +19,7 @@ import ( "strings" ) -var version string = "0.23.0" +var version string = "0.23.1" func Full() string { return version