#!/usr/bin/env escript %% -*- erlang -*- %%! -sname wait_node -pa ./ebin main([NodeStr, PidFile]) -> case {code:load_file(rabbit_misc), code:load_file(rabbit_nodes)} of {{module, _}, {module, _}} -> ok; _ -> io:format("Compile with 'make' before running this script~n"), halt(1) end, Node = rabbit_nodes:make(NodeStr), Pid = rabbit_misc:read_pid_file(PidFile, true), io:format("pid is ~s~n", [Pid]), rabbit_misc:wait_for_application(Node, Pid, kernel); main(_) -> usage(). usage() -> io:format("Usage: ./wait_node node pidfile~n"), halt(1).