Commit ade41e3a authored by Robert Ricci's avatar Robert Ricci

Now calls 'cd $pwd ; command' on paper, so that it also works with people

who have real shells on paper.
parent b6d20956
......@@ -12,13 +12,19 @@ $nopass = "-o 'BatchMode yes'";
# Turn off host key checking.... for now.
$nokeycheck = "-o 'StrictHostKeyChecking No'";
# Make sure we use the right identity file
$identity = "-i $ENV{HOME}/.ssh/identity";
# Current working directory:
$cwd = $ENV{PWD};
# Now, do the magic
$rv = system "$ssh $host $nopass $nokeycheck dir=$cwd $0 @ARGV";
$rv = system "$ssh $identity $nopass $nokeycheck $host 'cd $cwd \; $0 @ARGV'";
if ($rv > 256) {
print "SSH failed. You may need to run the following commands:\n";
print "mkdir $ENV{HOME}/.ssh\n";
print "**********\n";
print "SSH failed. You may need to run the following commands:\n\n";
print "mkdir -m 0755 $ENV{HOME}/.ssh\n";
print "ssh-keygen -P '' -f $ENV{HOME}/.ssh/identity\n";
print "cp $ENV{HOME}/.ssh/identity.pub $ENV{HOME}/.ssh/authorized_keys\n";
print "chmod 600 $ENV{HOME}/.ssh/authorized_keys\n";
print "**********\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment