Subversion Repositories zfs_utils

Rev

Rev 12 | Rev 16 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 14
Line 71... Line 71...
71
}
71
}
72
   
72
   
73
# grabs the encryption key from the remote server, and uses it to unlock the 
73
# grabs the encryption key from the remote server, and uses it to unlock the 
74
# datasets, then mount the drives.
74
# datasets, then mount the drives.
75
# a return of '' is success, anything else is an error
75
# a return of '' is success, anything else is an error
-
 
76
# THIS IS SERIOUSLY BROKEN. DON'T USE
76
sub mountDrives {
77
sub mountDrives {
77
   my $configuration = shift;
78
   my $configuration = shift;
78
   return (0, 'No encrypted target found' ) unless defined( $configuration->{'target'}->{'encryptionKeyPath'} ) && $configuration->{'target'}->{'encryptionKeyPath'};
79
   return (0, 'No encrypted target found' ) unless defined( $configuration->{'target'}->{'encryptionKeyPath'} ) && $configuration->{'target'}->{'encryptionKeyPath'};
79
   # try to grab the file from the remote machine
80
   # try to grab the file from the remote machine
80
   &runCommand( "scp $configuration->{remoteMachine}->{ip}:$configuration->{remoteMachine}->{encryptionKeyPath} $configuration->{localMachine}->{encryptionKeyPath}" );
81
   &runCommand( "scp $configuration->{remoteMachine}->{ip}:$configuration->{remoteMachine}->{encryptionKeyPath} $configuration->{localMachine}->{encryptionKeyPath}" );
Line 112... Line 113...
112
# checks to see if we should be in maintenance mode
113
# checks to see if we should be in maintenance mode
113
# if $remoteMachine->{'maintenanceMode'} exists, set mode
114
# if $remoteMachine->{'maintenanceMode'} exists, set mode
114
# otherwise, wait localMachine->{'waittime'} minutes, then check
115
# otherwise, wait localMachine->{'waittime'} minutes, then check
115
# $localMachine->{'maintenanceMode'}.
116
# $localMachine->{'maintenanceMode'}.
116
# if neither exists, begin sync
117
# if neither exists, begin sync
-
 
118
# THIS IS BROKEN, DON'T USE
117
sub checkMaintenance {
119
sub checkMaintenance {
118
   my $configuration = shift;
120
   my $configuration = shift;
119
   return 0 unless # exit if maintenanceFlag has not been set at all
121
   return 0 unless # exit if maintenanceFlag has not been set at all
120
     ( defined( $configuration->{'target'}->{'maintenanceFlag'} ) && $configuration->{'target'}->{'maintenanceFlag'} ) ||
122
     ( defined( $configuration->{'target'}->{'maintenanceFlag'} ) && $configuration->{'target'}->{'maintenanceFlag'} ) ||
121
     ( defined( $configuration->{'source'}->{'maintenanceFlag'} ) && $configuration->{'source'}->{'maintenanceFlag'} );
123
     ( defined( $configuration->{'source'}->{'maintenanceFlag'} ) && $configuration->{'source'}->{'maintenanceFlag'} );