Tell ssh to allocate tty if rsc is runs on a tty.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 25 Aug 2007 00:26:45 +0000 (00:26 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sat, 25 Aug 2007 00:26:45 +0000 (00:26 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@1098 959494ce-11ee-0310-bf91-de5d638817bd

rsc

diff --git a/rsc b/rsc
index 9e7e760..c915aab 100755 (executable)
--- a/rsc
+++ b/rsc
@@ -39,6 +39,9 @@ if($ARGV[0] eq "-s") {
     }
     $ea = encode_base64($arg);
     $ea =~ s/\n//g;
-    exec "ssh", "$host", "rsc", "-s", $ea;
+    if(-t STDIN) {
+       push @sshopts, "-t";
+    }
+    exec "ssh", @sshopts, "$host", "rsc", "-s", $ea;
     die "$!";
 }