Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added environment variable to specifiy .fornodesrc file

In our environment, _fornodes_ and _atnodes_ is run from various hosts and it becomes a pain to keep these files in sync. Providing a central (versioned) file that is accessible on all servers is a big plus.
  • Loading branch information...
commit 9572df3cacd0ec6d94bf94fba6aca0f376f85d13 1 parent 7b75623
@mithun mithun authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 lib/SSH/Batch/ForNodes.pm
View
13 lib/SSH/Batch/ForNodes.pm
@@ -27,11 +27,14 @@ sub clear_universe () {
}
sub init_rc () {
- my $home = $ENV{SSH_BATCH_HOME} || File::HomeDir->my_home;
- if (!defined $home || !-d $home) {
- die "Can't find the home for the current user.\n";
- }
- my $rcfile = "$home/.fornodesrc";
+ my $rcfile = $ENV{SSH_BATCH_RC} || q();
+ if(! $rcfile){
+ my $home = $ENV{SSH_BATCH_HOME} || File::HomeDir->my_home;
+ if (!defined $home || !-d $home) {
+ die "Can't find the home for the current user.\n";
+ }
+ $rcfile = "$home/.fornodesrc";
+ }
# auto create $rcfile if $rcfile not exists
if (! -e $rcfile) {
Please sign in to comment.
Something went wrong with that request. Please try again.