mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Shell Environment Variables in config
Adding updated Nini and support to use shell environment variables in OpenSimulator configuration. Nini @ https://github.com/BlueWall/Nini-Dev
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OpenSim
|
||||
/// <param name="networkInfo"></param>
|
||||
/// <returns>A configuration that gets passed to modules</returns>
|
||||
public OpenSimConfigSource LoadConfigSettings(
|
||||
IConfigSource argvSource, out ConfigSettings configSettings,
|
||||
IConfigSource argvSource, EnvConfigSource envConfigSource, out ConfigSettings configSettings,
|
||||
out NetworkServersInfo networkInfo)
|
||||
{
|
||||
m_configSettings = configSettings = new ConfigSettings();
|
||||
@@ -195,6 +195,24 @@ namespace OpenSim
|
||||
// Make sure command line options take precedence
|
||||
m_config.Source.Merge(argvSource);
|
||||
|
||||
|
||||
IConfig enVars = m_config.Source.Configs["Environment"];
|
||||
|
||||
if( enVars != null )
|
||||
{
|
||||
string[] env_keys = enVars.GetKeys();
|
||||
|
||||
foreach ( string key in env_keys )
|
||||
{
|
||||
envConfigSource.AddEnv(key, string.Empty);
|
||||
}
|
||||
|
||||
envConfigSource.LoadEnv();
|
||||
m_config.Source.Merge(envConfigSource);
|
||||
m_config.Source.ExpandKeyValues();
|
||||
}
|
||||
|
||||
|
||||
ReadConfigSettings();
|
||||
|
||||
return m_config;
|
||||
|
||||
Reference in New Issue
Block a user