I think escript might be interesting.
Edit: Some examples.
First for all the examples: somehow start the remote node.
dannib@duval:~:> erl -sname bar
(bar@duval)1> erlang:get_cookie().
'KNKKCFPYMJUPIOLYPOAA'
Escript
1: create a file with a name hello.escriptwith content
%%! -sname foo@duval -setcookie KNKKCFPYMJUPIOLYPOAA
main(_String) ->
Node = 'bar@duval',
Mod = 'erlang',
Fun = 'node',
Args = [],
R = rpc:call(Node, Mod, Fun, Args),
io:format("Hello there ~p~n",[R]).
, %%! -sname foo@bar node ( unode @nohost), cookie %%! -sname foo@duvel -setcookie KNKKCFPYMJUPIOLYPOAA, , {badrpc,nodedown}. , (erl_call -eval), node cookie.
2:
$ chmod +x hello.escript
$ ./hello.escript
Hello there bar@duval
Erl_call
1:
$ erl_call -c 'KNKKCFPYMJUPIOLYPOAA' -a 'erlang node' -n bar@duval
bar@duval
Eval
1:
$ erl -sname foo -setcookie 'KNKKCFPYMJUPIOLYPOAA'
-eval 'io:format("Hello there ~p~n",[rpc:call(bar@duval,erlang, node, [])])'
... Eshell V5.7.4 (abort with ^G)
(foo@duval)1> Hello there bar@duval
, , .
, cookie, cookie foo bar , .
, , , , erl_call. "" , imho- "" . _String escript script, erlang EVM. erl_call , , erlang node.