diff options
Diffstat (limited to 'priv')
-rw-r--r-- | priv/templates/simpleevent.erl | 60 | ||||
-rw-r--r-- | priv/templates/simpleevent.template | 2 | ||||
-rwxr-xr-x | priv/templates/simplenode.runner | 2 |
3 files changed, 63 insertions, 1 deletions
diff --git a/priv/templates/simpleevent.erl b/priv/templates/simpleevent.erl new file mode 100644 index 0000000..1d529a3 --- /dev/null +++ b/priv/templates/simpleevent.erl @@ -0,0 +1,60 @@ +-module({{eventid}}). +-behaviour(gen_event). + +%% ------------------------------------------------------------------ +%% API Function Exports +%% ------------------------------------------------------------------ + +-export([start_link/0, + add_handler/2]). + +%% ------------------------------------------------------------------ +%% gen_event Function Exports +%% ------------------------------------------------------------------ + +-export([init/1, + handle_event/2, + handle_call/2, + handle_info/2, + terminate/2, + code_change/3]). + +-record(state, {}). + +%% ------------------------------------------------------------------ +%% API Function Definitions +%% ------------------------------------------------------------------ + +start_link() -> + gen_event:start_link({local, ?MODULE}). + +add_handler(Handler, Args) -> + gen_event:add_handler(?MODULE, Handler, Args). + +%% ------------------------------------------------------------------ +%% gen_event Function Definitions +%% ------------------------------------------------------------------ + +init([]) -> + {ok, #state{}}. + +handle_event(_Event, State) -> + {ok, State}. + +handle_call(_Request, State) -> + Reply = ok, + {ok, Reply, State}. + +handle_info(_Info, State) -> + {ok, State}. + +terminate(_Reason, _State) -> + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%% ------------------------------------------------------------------ +%% Internal Function Definitions +%% ------------------------------------------------------------------ + diff --git a/priv/templates/simpleevent.template b/priv/templates/simpleevent.template new file mode 100644 index 0000000..68f3894 --- /dev/null +++ b/priv/templates/simpleevent.template @@ -0,0 +1,2 @@ +{variables, [{eventid, "myevent"}]}. +{template, "simpleevent.erl", "src/{{eventid}}.erl"}. diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner index 595a1ea..3e9e10f 100755 --- a/priv/templates/simplenode.runner +++ b/priv/templates/simplenode.runner @@ -100,7 +100,7 @@ case "$REMSH_NAME" in *) REMSH_NAME_PART="$REMSH_NAME" if [ "$REMSH_TYPE" = "-sname" ]; then - REMSH_HOSTNAME_PART= "$HOSTNAME" + REMSH_HOSTNAME_PART="$HOSTNAME" else # -name type, check if `hostname` is fqdn if [ "$MAYBE_FQDN_HOSTNAME" = "$HOSTNAME" ]; then |