зеркало из https://github.com/mozilla/mig.git
Allow users to specify the path to the mig-agent.cfg template if they want to
This commit is contained in:
Родитель
dd79fd58e6
Коммит
19f6e1b6f7
|
@ -95,14 +95,12 @@ func (proxies *proxyList) Set(value string) error {
|
|||
}
|
||||
|
||||
func main() {
|
||||
templateFilePath := path.Join(configTemplateDir, configTemplateFile)
|
||||
fmt.Fprintf(os.Stderr, "Trying to load template %s\n", templateFilePath)
|
||||
template, err := template.ParseFiles(templateFilePath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error parsing template configuration: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
defaultTemplateFilePath := path.Join(configTemplateDir, configTemplateFile)
|
||||
|
||||
templateFilePath := flag.String(
|
||||
"template",
|
||||
defaultTemplateFilePath,
|
||||
"Path to the mig-agent.cfg template to fill")
|
||||
relayAddr := flag.String(
|
||||
"relay",
|
||||
"",
|
||||
|
@ -138,6 +136,13 @@ func main() {
|
|||
"Instruct the agent to run with extra privacy controls")
|
||||
flag.Parse()
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Trying to load template %s\n", *templateFilePath)
|
||||
template, err := template.ParseFiles(*templateFilePath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error parsing template configuration: %s\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
config := Config{
|
||||
RelayAddress: *relayAddr,
|
||||
APIURL: *apiUrl,
|
||||
|
|
Загрузка…
Ссылка в новой задаче