File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -1406,21 +1406,18 @@ motd_file() ->
1406
1406
% % 1. The environment variable;
1407
1407
% % 2. The `motd_file` configuration parameter;
1408
1408
% % 3. The default value.
1409
- case os :getenv (" RABBITMQ_MOTD_FILE" ) of
1410
- false ->
1411
- string_from_app_env (motd_file , default_motd_file ());
1412
- Val ->
1413
- Val
1414
- end .
1415
-
1416
- default_motd_file () ->
1417
- EnabledPluginsFile = rabbit_plugins :enabled_plugins_file (),
1418
- ConfigDir = filename :dirname (EnabledPluginsFile ),
1419
- case os :type () of
1420
- {unix , _ } ->
1421
- filename :join (ConfigDir , " motd" );
1422
- {win32 , _ } ->
1423
- filename :join (ConfigDir , " motd.txt" )
1409
+ Context = rabbit_env :get_context (),
1410
+ case Context of
1411
+ #{motd_file := File ,
1412
+ var_origins := #{motd_file := environment }}
1413
+ when File =/= undefined ->
1414
+ File ;
1415
+ _ ->
1416
+ Default = case Context of
1417
+ #{motd_file := File } -> File ;
1418
+ _ -> undefined
1419
+ end ,
1420
+ string_from_app_env (motd_file , Default )
1424
1421
end .
1425
1422
1426
1423
motd () ->
You can’t perform that action at this time.
0 commit comments