- my $orig = `$SSLPATH md5 $fspath`;
- my $snap = `$SSLPATH md5 $snappath`;
- $orig =~ /[\s\S]+= (.+)/;
- my $sum1 = $1;
- $snap =~ /[\s\S]+= (.+)/;
- my $sum2 = $1;
- if ($sum1 ne $sum2) {
- print "** Files are different\n";
- print "** $orig** $snap" if $verbose;
+ if($options{md5sum}) {
+ my $orig = `$SSLPATH md5 $fspath`;
+ my $snap = `$SSLPATH md5 $snappath`;
+ $orig =~ /[\s\S]+= (.+)/;
+ my $sum1 = $1;
+ $snap =~ /[\s\S]+= (.+)/;
+ my $sum2 = $1;
+ if ($sum1 ne $sum2) {
+ print "** Files are different\n";
+ print "** $orig** $snap" if $verbose;
+ }
+ } else {
+ my $differ = system("diff \"$fspath\" \"$snappath\" > /dev/null 2>&1");
+ if($differ) { print "** Files are different\n"; }