GajuMine/src/gajumine.erl

45 lines
1.1 KiB
Erlang

%%% @doc
%%% GajuMine
%%% @end
-module(gajumine).
-vsn("0.2.6").
-behavior(application).
-author("Craig Everett <craigeverett@qpq.swiss>").
-copyright("QPQ AG <craigeverett@qpq.swiss>").
-license("GPL-3.0-or-later").
-export([start/2, stop/1, exec_bin_dir/0]).
-include("$zx_include/zx_logger.hrl").
-spec start(normal, Args :: term()) -> {ok, pid()}.
start(normal, _Args) ->
ok =
case net_kernel:stop() of
ok ->
log(info, "SAFE: This node is running standalone.");
{error, not_found} ->
log(warning, "SAFETY: Distribution has been disabled on this node.");
{error, not_allowed} ->
ok = tell(error, "DANGER! This node is in distributed mode!"),
init:stop(1)
end,
{ok, _} = application:ensure_all_started(ssl),
ok = application:ensure_started(hakuzaru),
ok = application:ensure_started(zxwidgets),
gmc_sup:start_link().
-spec stop(term()) -> ok.
stop(_State) ->
ok.
-spec exec_bin_dir() -> file:filename().
exec_bin_dir() ->
gmc_con:bin_dir().