| 1 | # | ||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||
| 3 | # | ||
| 4 | # vim: set ts=3 sw=3 tw=0: | ||
| 5 | # vim: set expandtab: | ||
| 6 | |||
| 7 | package Rex::Endpoint::HTTP::Interface::Exec::Base; | ||
| 8 | |||
| 9 | use strict; | ||
| 10 | use warnings; | ||
| 11 | |||
| 12 | sub new { | ||
| 13 | my $that = shift; | ||
| 14 | my $proto = ref($that) || $that; | ||
| 15 | my $self = { @_ }; | ||
| 16 | |||
| 17 | bless($self, $proto); | ||
| 18 | |||
| 19 | return $self; | ||
| 20 | } | ||
| 21 | |||
| 22 | sub exec { | ||
| 23 | my ($self, $cmd) = @_; | ||
| 24 | |||
| 25 | my $out = qx{$cmd}; | ||
| 26 | |||
| 27 | return $out; | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; |