From ffe8c905b100be080033b09b223d9d2a4ec3a201 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 16 Feb 2008 22:53:33 +1300 Subject: [PATCH] Add debug mode. --- mirror | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mirror b/mirror index 45fea35..b67b9a3 100644 --- a/mirror +++ b/mirror @@ -99,10 +99,13 @@ use Getopt::Long; my $config_file = "mirror.yaml"; my $sync = undef; +my $DEBUG = undef; my $lock_file = "/var/lock/mirror-" . hostname; GetOptions("config|c=s" => $config_file, - "sync|s" => $sync); + "sync|s" => $sync, + "debug|d" => $DEBUG, +); my @errors = (); my @warnings = (); @@ -280,6 +283,11 @@ sub run_and_check { $cmd = "$c->{$rmtssh} \"$cmd\"" if defined $c->{rmtssh}; + if (defined $DEBUG) { + print "Want to run: $cmd\n"; + return; + } + system($cmd); if ($? >> 8 != 0) { push @errors, "Command \"$cmd\" failed with return code " . ($? >> 8); -- 2.30.2