0
votes

Part of setting up my ejabberd server includes running ejabberdctl debug and entering some commands. Instead, I would like to have a file that is executed, but have it run from the same context of the ejabberdctl debug REPL. How can I do this?

1

1 Answers

1
votes

You can use the rpc:call command. The Node value is what you see at the debug prompt "name@host".

Also, make sure the escript sets the appropriate cookie value.

Let me clarify, if the debug environment looked like this:

(ejabberd@host)1>

You can create a escript file which looks like this. This updates the log level:

#!/usr/bin/env escript

%%! -sname script1 -setcookie cookie -hidden
main([Level]) ->
   rpc:call('ejabberd@host', ejabberd_loglevel, set, [list_to_atom(Level)]).