summaryrefslogtreecommitdiff
path: root/scripts/vyatta-banner.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-banner.pl')
-rw-r--r--scripts/vyatta-banner.pl14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/vyatta-banner.pl b/scripts/vyatta-banner.pl
index 8c3db846..7ae35edf 100644
--- a/scripts/vyatta-banner.pl
+++ b/scripts/vyatta-banner.pl
@@ -33,8 +33,7 @@ use Vyatta::Config;
use Getopt::Long;
use File::Copy;
-use Digest::MD5 qw(md5_hex);
-use Digest::file qw(digest_file_hex);
+use File::Compare;
use strict;
use warnings;
@@ -61,9 +60,14 @@ sub is_same_as_file {
my ($file, $value) = @_;
return if ! -e $file;
- my $fdigest = digest_file_hex($file, "MD5");
- my $vdigest = md5_hex("$value");
- return 1 if $fdigest eq $vdigest;
+
+ my $mem_file;
+ open my $MF, '+<', \$mem_file or die "couldn't open memfile $!\n";
+ print $MF $value;
+ seek($MF, 0, 0);
+
+ my $rc = compare($file, $MF);
+ return 1 if $rc == 0;
return;
}