Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env escript
- %%! -pa _build/default/lib/bbmustache/ebin
- main([]) ->
- OutputFilePath= <<"/etc/mongooseim/mongooseim.cfg">>,
- TemplateFile= <<"/root/mongooseimru/rel/files/mongooseim.cfg">>,
- {ok, Template} = file:read_file(TemplateFile),
- {ok, Vars} = file:consult("rel/vars.config"),
- %io:format("~p -- ~p",[Template,Vars])
- CfgFile = bbmustache:render(Template, maps:from_list(Vars),
- [{key_type, atom}]),
- %io:format("~p ",[CfgFile]) .
- R= file:write_file(OutputFilePath, CfgFile),
- io:format("~p ",[R])
- .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement