]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_ctl.erl: Added new command: mnesia (thanks to
authorBadlop <badlop@process-one.net>
Fri, 21 Dec 2007 21:50:22 +0000 (21:50 +0000)
committerBadlop <badlop@process-one.net>
Fri, 21 Dec 2007 21:50:22 +0000 (21:50 +0000)
Tsukasa Hamano)

SVN Revision: 1094

ChangeLog
src/ejabberd_ctl.erl

index 41f139f19b302ea7779a754cc2bec994e57c0171..c725e5394c7fe21ae01189443deb8713cd76d26d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-21  Badlop  <badlop@process-one.net>
+
+       * src/ejabberd_ctl.erl: Added new command: mnesia (thanks to
+       Tsukasa Hamano)
+
 2007-12-21  Mickael Remond  <mremond@process-one.net>
 
        * src/msgs/fr.msg: Updated French translation (EJAB-295)
index dfec4bf07c83694503d2b9842b095b4d406e22ec..612daab4c77db36d9659e2178b84f1b617b03b59 100644 (file)
@@ -188,6 +188,21 @@ process(["delete-expired-messages"]) ->
     mod_offline:remove_expired_messages(),
     ?STATUS_SUCCESS;
 
+process(["mnesia"]) ->
+    io:format("~p~n", [mnesia:system_info(all)]),
+    ?STATUS_SUCCESS;
+
+process(["mnesia", "info"]) ->
+    mnesia:info(),
+    ?STATUS_SUCCESS;
+
+process(["mnesia", Arg]) when is_list(Arg) ->
+    case catch mnesia:system_info(list_to_atom(Arg)) of
+       {'EXIT', Error} -> io:format("Error: ~p~n", [Error]);
+       Return -> io:format("~p~n", [Return])
+    end,
+    ?STATUS_SUCCESS;
+
 process(["delete-old-messages", Days]) ->
     case catch list_to_integer(Days) of
        {'EXIT',{Reason, _Stack}} ->
@@ -246,6 +261,7 @@ print_usage() ->
         {"import-dir dir", "import user data from jabberd 1.4 spool directory"},
         {"delete-expired-messages", "delete expired offline messages from database"},
         {"delete-old-messages n", "delete offline messages older than n days from database"},
+        {"mnesia [info]", "show information of Mnesia system"},
         {"vhost host ...", "execute host-specific commands"}] ++
        ets:tab2list(ejabberd_ctl_cmds),
     MaxCmdLen =