http://qs321.pair.com?node_id=1147105


in reply to ciscodump - dump config info from routers into files

One way to avoid having the password documented in the config file, is to provide the user of the script the option of setting it in their shell's ENV instead. This would be temporary and only visible within the current shell running the script. If they have different passwords for each device, it would be cumbersome (it could be done though). Here's an (untested) example:

my $pass; if (defined $ENV{PASS}){ $pass = $ENV{PASS}; } elsif (defined $ini->{$host}{pass}){ $pass = $ini->{$host}{pass}; } elsif (defined $ini->{_}{pass}) { $pass = $ini->{_}{pass} } else { die "no password could be found"; }

Replies are listed 'Best First'.
Re^2: ciscodump - dump config info from routers into files
by soonix (Canon) on Nov 06, 2015 at 20:44 UTC

    Yes, that would have been an option, as in my case, there was only 1 system with a different password.

    But as we are using KeePass already, the next step may probably incorporating File::KeePass. Now, the password for the KeePass database… ;-)