Skip to content

Commit a5fd8fd

Browse files
committed
z
1 parent e2db402 commit a5fd8fd

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

dist/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31133,11 +31133,15 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
3113331133
let waitForKey = waitFor(pubkeyContent, () => {
3113431134
ready_callback(qemu_process)
3113531135
})
31136-
qemu_process.stdout.on('data', waitForKey)
31137-
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
31138-
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
31136+
qemu_process.stdout.on('data', data => {
31137+
process.stdout.write(data.toString())
31138+
waitForKey(data)
31139+
})
31140+
3113931141
qemu_process.stdin.write(`echo "${pubkeyContent}" > /root/.ssh/authorized_keys\n`);
3114031142
qemu_process.stdin.write(`cat /root/.ssh/authorized_keys\n`);
31143+
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
31144+
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
3114131145
})
3114231146
qemu_process.stdout.on('data', (data) => {
3114331147
waitForPrompt(data)

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
243243
let waitForKey = waitFor(pubkeyContent, () => {
244244
ready_callback(qemu_process)
245245
})
246-
qemu_process.stdout.on('data', waitForKey)
247-
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
248-
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
246+
qemu_process.stdout.on('data', data => {
247+
process.stdout.write(data.toString())
248+
waitForKey(data)
249+
})
250+
249251
qemu_process.stdin.write(`echo "${pubkeyContent}" > /root/.ssh/authorized_keys\n`);
250252
qemu_process.stdin.write(`cat /root/.ssh/authorized_keys\n`);
253+
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
254+
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
251255
})
252256
qemu_process.stdout.on('data', (data) => {
253257
waitForPrompt(data)

0 commit comments

Comments
 (0)