diff options
Diffstat (limited to 'lib/App/Ping903/Command/ipadd.pm')
-rw-r--r-- | lib/App/Ping903/Command/ipadd.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/App/Ping903/Command/ipadd.pm b/lib/App/Ping903/Command/ipadd.pm new file mode 100644 index 0000000..a516aba --- /dev/null +++ b/lib/App/Ping903/Command/ipadd.pm @@ -0,0 +1,16 @@ +package App::Ping903::Command::ipadd; +use strict; +use warnings; +use parent 'App::Ping903::Command'; +use App::Ping903::Command ':exit_codes'; + +sub run { + my $self = shift; + $self->SUPER::run; + $self->usage_error("required parameters missing") unless @ARGV == 1; + my $ip = shift @ARGV; + unless ($self->agent->ipadd($ip)) { + $self->abend(EX_FAIL, $self->agent->error_message); + } +} +1; |