Skip to content

Commit

Permalink
allow @tag for hostconfig selection
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwutz committed Jun 13, 2016
1 parent 6fa0510 commit 3e163e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mxstartup2mxconfig
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ sub print_ips_cfg {

##############################################################################

sub hostconfig_list {
my $tag = shift;
$_=`/usr/sbin/hostconfig --list $tag 2>/dev/null`;
return ( split );
}


sub expand_hosts {
Expand All @@ -256,7 +261,10 @@ sub expand_hosts {


foreach my $host (@oh) {
if ($host =~ /^(\/\S+)/) {
if($host =~ /^\@(\S+)/) {
push @hosts, hostconfig_list($1);
}
elsif ($host =~ /^(\/\S+)/) {
next unless(-r $1);
push @hosts, expand_hosts(read_file($1));
} else {
Expand Down

0 comments on commit 3e163e5

Please sign in to comment.