# Paul Mantz <pcmantz@zmanda.com>
#
# COPYRIGHT
-# Copyright (C) 2008 Zmanda
+# Copyright (C) 2001-2009 Craig Barratt
#
# 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
#
#========================================================================
#
-# Version 3.1.0+
+# Version 3.2.0, released 31 Jul 2010.
#
# See http://backuppc.sourceforge.net.
#
return $ShareNames;
}
+
+sub getRestoreCmd
+{
+ my($conf) = @_;
+ my $restoreCmd;
+
+ if ( $conf->{XferMethod} eq "archive" ) {
+ $restoreCmd = undef;
+
+ } elsif ( $conf->{XferMethod} eq "ftp" ) {
+ $restoreCmd = undef;
+
+ } elsif ( $conf->{XferMethod} eq "rsync"
+ || $conf->{XferMethod} eq "rsyncd" ) {
+ $restoreCmd = $conf->{RsyncRestoreArgs};
+
+ } elsif ( $conf->{XferMethod} eq "tar" ) {
+ $restoreCmd = $conf->{TarClientRestoreCmd};
+
+ } elsif ( $conf->{XferMethod} eq "smb" ) {
+ $restoreCmd = $conf->{SmbClientRestoreCmd};
+
+ } else {
+
+ #
+ # protocol unrecognized
+ #
+ $restoreCmd = undef;
+ }
+ return $restoreCmd;
+}
+
+
+sub restoreEnabled
+{
+ my($conf) = @_;
+ my $restoreCmd;
+
+ if ( $conf->{XferMethod} eq "archive" ) {
+ return;
+
+ } elsif ( $conf->{XferMethod} eq "ftp" ) {
+ return;
+
+ } elsif ( $conf->{XferMethod} eq "rsync"
+ || $conf->{XferMethod} eq "rsyncd"
+ || $conf->{XferMethod} eq "tar"
+ || $conf->{XferMethod} eq "smb" ) {
+ $restoreCmd = getRestoreCmd( $conf );
+ return !!(
+ ref $restoreCmd eq "ARRAY"
+ ? @$restoreCmd
+ : $restoreCmd ne ""
+ );
+
+ } else {
+ return;
+ }
+}
+
+
sub errStr
{
return $errStr;