diff options
author | Greg Sabino Mullane | 2014-10-30 21:02:50 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2014-10-30 21:02:50 +0000 |
commit | 900b0887df0f7367b33b0576102df1d8a937cef4 (patch) | |
tree | 7fc539d294c14278ea00c61c5016361f24f1e24a /check_postgres.pl | |
parent | 5cb4297143e846568de89e4d33c203298bbfd645 (diff) |
Merge dbname2, host2, etc. into the new array method.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index f68167cce..a48e36fba 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1001,22 +1001,22 @@ while (my $arg = pop @ARGV) { if ($arg =~ /^\-?\-?(\w+)\s*=\s*(.+)/o) { my ($name,$value) = (lc $1, $2); if ($name =~ /^(?:db)?port(\d+)$/o or $name =~ /^p(\d+)$/o) { - $opt{"port$1"} = $value; + push @{ $opt{port} } => $value; } elsif ($name =~ /^(?:db)?host(\d+)$/o or $name =~ /^H(\d+)$/o) { - $opt{"host$1"} = $value; + push @{ $opt{host} } => $value; } elsif ($name =~ /^db(?:name)?(\d+)$/o) { - $opt{"dbname$1"} = $value; + push @{ $opt{dbname} } => $value; } elsif ($name =~ /^dbuser(\d+)$/o or $name =~ /^u(\d+)/o) { - $opt{"dbuser$1"} = $value; + push @{ $opt{dbuser} } => $value; } elsif ($name =~ /^dbpass(\d+)$/o) { - $opt{"dbpass$1"} = $value; + push @{ $opt{dbpass} } => $value; } elsif ($name =~ /^dbservice(\d+)$/o) { - $opt{"dbservice$1"} = $value; + push @{ $opt{dbservice} } => $value; } else { push @badargs => $arg; |