#!@PERL@
-# Copyright (c) 2009, 2010 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2009-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
use IO::Handle;
use Amanda::Constants;
use Amanda::Debug qw( :logging );
-use Amanda::Util;
+use Amanda::Util qw( quote_string );
sub new {
my $class = shift;
sub command_selfcheck {
my $self = shift;
- print "OK " . $self->{disk} . "\n";
- print "OK " . $self->{device} . "\n";
+ $self->print_to_server("disk " . quote_string($self->{disk}),
+ $Amanda::Script_App::GOOD)
+ if defined $self->{disk};
+
+ $self->print_to_server("amraw version " . $Amanda::Constants::VERSION,
+ $Amanda::Script_App::GOOD);
+
+ $self->print_to_server(quote_string($self->{device}),
+ $Amanda::Script_App::GOOD)
+ if defined $self->{device};
if (! -r $self->{device}) {
$self->print_to_server("$self->{device} can't be read",