Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new utils module for starting/stopping the server

  • Loading branch information...
commit 13cda19c69ec49e2ca786ab46f485ee17ecac339 1 parent 6169ca4
Alvaro Videla authored
4 sbin/rmqchat.sh
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd `dirname $0`
+exec erl -sname rmqchat_admin -pa $PWD/../ebin #\
+#-s rmqchat_utils stop $1 $2 -noshell -s init stop
3  src/rabbitmq_chat.app.src
View
@@ -7,7 +7,8 @@
rabbitmq_chat_app,
rabbitmq_chat_consumer,
rabbitmq_chat_rest,
- rabbitmq_chat_sup
+ rabbitmq_chat_sup,
+ rmqchat_utils.erl
]},
{registered, []},
{applications, [
15 src/rmqchat_utils.erl
View
@@ -0,0 +1,15 @@
+-module(rmqchat_utils).
+
+-export([start/1, stop/1, halt_node/1]).
+
+start([Node, App]) ->
+ pong = net_adm:ping(Node),
+ rpc:call(Node, application, start, [App]).
+
+stop([Node, App]) ->
+ pong = net_adm:ping(Node),
+ rpc:call(Node, application, stop, [App]).
+
+halt_node([Node]) ->
+ pong = net_adm:ping(Node),
+ rpc:call(Node, init, stop, []).
Please sign in to comment.
Something went wrong with that request. Please try again.