From c2ce3d81e1528b01daf88e8f6f75766bcb0a749a Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Wed, 17 Nov 2010 23:17:04 +0000 Subject: [PATCH] Improve os detection for newer versions. Improve forward compatibility. --- Info/Layer2/Baystack.pm | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Info/Layer2/Baystack.pm b/Info/Layer2/Baystack.pm index f972f3c2..19029880 100644 --- a/Info/Layer2/Baystack.pm +++ b/Info/Layer2/Baystack.pm @@ -82,20 +82,26 @@ sub os { my $descr = $baystack->description(); my $model = $baystack->model(); - if (( defined $model - and $model - =~ /(325|420|425|470|460|BPS|2500|3510|4524|4526|4548|4550|5510|5520|5530)/ - ) - and ( defined $descr and $descr =~ m/SW:v[3-5]/i ) - ) - { - return 'boss'; - } if ( ( defined $descr and $descr =~ /Business Ethernet Switch.*SW:v/i ) ) { return 'bes'; } - return 'baystack'; + if ( + ( + (defined $model and $model =~ /(420|425|BPS)/ ) + and + (defined $descr and $descr =~ m/SW:v[1-2]/i ) + ) + or + ( + (defined $model and $model =~ /(410|450|380)/ ) + ) + ) + { + return 'baystack'; + } + + return 'boss'; } sub os_bin {