mirror of
https://github.com/lwch/natpass
synced 2025-10-15 09:30:35 +08:00
修改conf参数为必填参数
This commit is contained in:
@@ -113,25 +113,20 @@ func main() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
var args []string
|
if len(*conf) == 0 {
|
||||||
if *act == "install" {
|
fmt.Println("missing -conf param")
|
||||||
if len(*conf) == 0 {
|
os.Exit(1)
|
||||||
fmt.Println("missing -conf param")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
dir, err := filepath.Abs(*conf)
|
|
||||||
runtime.Assert(err)
|
|
||||||
args = append(args, "-conf", dir)
|
|
||||||
} else {
|
|
||||||
args = append(args, "-conf", *conf)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dir, err := filepath.Abs(*conf)
|
||||||
|
runtime.Assert(err)
|
||||||
|
|
||||||
appCfg := &service.Config{
|
appCfg := &service.Config{
|
||||||
Name: "natpass",
|
Name: "natpass",
|
||||||
DisplayName: "natpass",
|
DisplayName: "natpass",
|
||||||
Description: "nat forward service",
|
Description: "nat forward service",
|
||||||
UserName: *user,
|
UserName: *user,
|
||||||
Arguments: args,
|
Arguments: []string{"-conf", dir},
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg := global.LoadConf(*conf)
|
cfg := global.LoadConf(*conf)
|
||||||
|
Reference in New Issue
Block a user