summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorivan <ivan>2009-05-03 00:40:50 +0000
committerivan <ivan>2009-05-03 00:40:50 +0000
commitae8f98d14eb70d671e808d41167ae6afb2ee7053 (patch)
treedb0e7b6d23a5069c9ed674bbf4cb54f4ae2d9ae6 /bin
parent5bdd15fbc33d0e273e787a49bfdeb014cf83481d (diff)
confdiff
Diffstat (limited to 'bin')
-rwxr-xr-xbin/confdiff27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/confdiff b/bin/confdiff
new file mode 100755
index 000000000..5b6af859e
--- /dev/null
+++ b/bin/confdiff
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+
+adminsuidsetup('ivan');
+
+my $conf = new FS::Conf;
+
+my $file2 = pop @ARGV;
+my $file1 = pop @ARGV;
+
+open(FILE1, ">/tmp/$file1") or die "can't open /tmp/$file1: $!";
+print FILE1 $conf->config($file1);
+print FILE1 "\n";
+close FILE1 or die $!;
+
+open(FILE2, ">/tmp/$file2") or die "can't open /tmp/$file2: $!";
+print FILE2 $conf->config($file2);
+print FILE2 "\n";
+close FILE2 or die $!;
+
+my @opt = @ARGV;
+
+system('diff', @opt, "/tmp/$file1", "/tmp/$file2");
+
+#unlink("/tmp/$file1', "/tmp/$file2");