Directly run the command in the shell

This commit is contained in:
blinry 2021-02-27 15:07:35 +01:00
parent 16edb843b7
commit a60b2f9afb
4 changed files with 17 additions and 19 deletions
scripts

View file

@ -23,24 +23,18 @@ while(true) {
$socket->recv($len, 4);
my $actual_len = unpack("L", $len);
if ($actual_len == 0) {
print("not connected");
#print("not connected");
exit;
}
print("still connected");
#print("still connected");
my $s2;
$socket->recv($s2, $actual_len);
print($s2);
#print($s2);
STDOUT->flush();
my $script;
open($script, ">", "/tmp/omgscript") or die $!;
#$s3 = 'export HOME=\'/home/blinry/.local/share/Oh My Git/tmp/\';export PATH=\'/home/blinry/.local/share/Oh My Git/tmp/:\'"$PATH";cd \'/home/blinry/.local/share/Oh My Git/tmp/repos/yours/\' || exit 1;find . -type f -not -path \'*/\\.git/*\'';
print $script $s2;
close($script);
$s = "";
$command = ". /tmp/omgscript" . "\necho MAGIC\n";
$command = $s2 . "\necho MAGIC\n";
print $in $command;
inner_while: while (true) {
@ -51,10 +45,10 @@ while(true) {
}
$s = $s . $line;
}
print "got complete output";
print $s;
#print "got complete output";
#print $s;
print length($s);
#print length($s);
STDOUT->flush();
my $send_length = pack("L", length($s));
$socket->send($send_length);