Skip to content

Commit

Permalink
Override config via cssh_* environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
babs committed Mar 31, 2021
1 parent 6cbec68 commit 0e2b3ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/App/ClusterSSH/Config.pm
Expand Up @@ -335,6 +335,15 @@ sub load_configs {
$self->parse_config_file($file) if ( -e $file );
}

# Override confuration via environment variable using cssh_ prefix
# eg: terminal_size => cssh_terminal_size
foreach my $config_key ( sort( keys(%default_config) ) ) {
my $env_config_key = "cssh_".$config_key;
if ( exists $ENV{$config_key} ) {
$self->{$config_key} = $ENV{$config_key};
}
}

return $self;
}

Expand Down

0 comments on commit 0e2b3ef

Please sign in to comment.