From: Andrew Ruthven <andrew@etc.gen.nz>
Date: Sat, 16 Feb 2008 10:14:05 +0000 (+1300)
Subject: Make use of $c->{'remote'}{'ssh'} consistent.
X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;p=mirror-perl.git

Make use of $c->{'remote'}{'ssh'} consistent.
---

diff --git a/mirror b/mirror
index e05ccd9..27d123f 100644
--- a/mirror
+++ b/mirror
@@ -159,7 +159,7 @@ sub load_config {
     die_gracefully("You've specified the remote host, but not the remote login.")
       unless defined $c->{'remote'}{'login'};
 
-    $c->{'rmtssh'} = "ssh "
+    $c->{'remote'}{'ssh'} = "ssh "
       . (defined $c->{'remote'}{'sshargs'} ? $c->{'remote'}{'sshargs'} . ' ' : '')
         . " -l $c->{'remote'}{'login'} $c->{'remote'}{'host'}";
   }
@@ -271,8 +271,8 @@ sub _docleanup {
 sub test {
   my ($test) = shift;
 
-  if (defined $c->{rmtssh}) {
-    system("$c->{rmtssh} [ $test ]");
+  if (defined $c->{'remote'}{'ssh'}) {
+    system("$c->{'remote'}{'ssh'} [ $test ]");
 
     return ($? >> 8);
   } else {
@@ -285,8 +285,8 @@ sub test {
 sub run_and_check {
   my ($cmd, $die) = shift;
 
-  $cmd = "$c->{$rmtssh} \"$cmd\""
-    if defined $c->{rmtssh};
+  $cmd = "$c->{'remote'}{'ssh'} \"$cmd\""
+    if defined $c->{'remote'}{'ssh'};
 
   if (defined $DEBUG) {
     print "Want to run: $cmd\n";
@@ -308,8 +308,8 @@ sub run_and_check {
 sub run_and_return {
   my ($cmd, $die) = shift;
 
-  $cmd = "$c->{$rmtssh} \"$cmd\""
-    if defined $c->{rmtssh};
+  $cmd = "$c->{'remote'}{'ssh'} \"$cmd\""
+    if defined $c->{'remote'}{'ssh'};
 
   my $output = `$cmd`;
   if ($? >> 8 != 0) {