diff options
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Xpp/Xpd.pm')
-rw-r--r-- | xpp/utils/zconf/Zaptel/Xpp/Xpd.pm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xpp/utils/zconf/Zaptel/Xpp/Xpd.pm b/xpp/utils/zconf/Zaptel/Xpp/Xpd.pm index 94176b8..852aaea 100644 --- a/xpp/utils/zconf/Zaptel/Xpp/Xpd.pm +++ b/xpp/utils/zconf/Zaptel/Xpp/Xpd.pm @@ -82,11 +82,17 @@ sub new($$) { bless $self, $pack; my $dir = "$proc_base/" . $self->fqn; $self->{DIR} = $dir; - my ($name) = glob "$dir/*_info"; - die "Missing info file in $dir" unless $name; - $name =~ s|^.*/||; # basename - die "Bad info file name ($name) in $dir" if $name !~ /(\w+)_info/; - $self->{TYPE} = uc($1); + open(F, "$dir/summary") || die "Missing summary file in $dir"; + my $head = <F>; + chomp $head; + # "XPD-00 (BRI_TE ,card present, span registered) SYNC MASTER" + close F; + $head =~ s/^.*\(//; + $head =~ s/\) */, /; + $head =~ s/\s*,\s*/,/g; + my ($type,$present,$registered,$sync) = split(/,/, $head); + $self->{TYPE} = uc($type); + $self->{IS_SYNC_MASTER} = ($sync =~ /MASTER/); return $self; } |