| 1 | # | ||
| 2 | # (c) adjust GmbH | ||
| 3 | # | ||
| 4 | # vim: set ts=2 sw=2 tw=0: | ||
| 5 | # vim: set expandtab: | ||
| 6 | |||
| 7 | package Rex::Interface::Shell::Idrac4; | ||
| 8 | |||
| 9 | # ABSTRACT: Rex module to support iDRAC 4.00.00.00 | ||
| 10 | |||
| 11 | use strict; | ||
| 12 | use warnings; | ||
| 13 | |||
| 14 | our $VERSION = 'v0.1.0'; | ||
| 15 | |||
| 16 | use Rex::Interface::Shell::Default; | ||
| 17 | use base qw(Rex::Interface::Shell::Default); | ||
| 18 | |||
| 19 | sub new { | ||
| 20 | my $class = shift; | ||
| 21 | my $proto = ref($class) || $class; | ||
| 22 | my $self = $proto->SUPER::new(@_); | ||
| 23 | |||
| 24 | bless $self, $class; | ||
| 25 | |||
| 26 | return $self; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub detect { | ||
| 30 | my ( $self, $con ) = @_; | ||
| 31 | |||
| 32 | my ($output); | ||
| 33 | eval { | ||
| 34 | ($output) = $con->direct_exec('racadm getversion'); | ||
| 35 | 1; | ||
| 36 | } or do { | ||
| 37 | return 0; | ||
| 38 | }; | ||
| 39 | if ( $output && $output =~ m/iDRAC Version/ms ) { | ||
| 40 | return 1; | ||
| 41 | } | ||
| 42 | |||
| 43 | return 0; | ||
| 44 | } | ||
| 45 | |||
| 46 | sub exec { | ||
| 47 | my ( $self, $cmd, $option ) = @_; | ||
| 48 | return $cmd; | ||
| 49 | } | ||
| 50 | |||
| 51 | 1; | ||
| 52 | |||
| 53 | __END__ |