Skip to content

Commit

Permalink
dfvd
Browse files Browse the repository at this point in the history
  • Loading branch information
shinohara-rin committed May 3, 2024
1 parent ef1cc7f commit e2db402
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31130,13 +31130,14 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
qemu_process.stdin.write("root\n");
let waitForPrompt = waitFor("root@freebsd:", () => {
waitForPrompt = () => { }
let waitForKey = waitFor(pubkeyContent, () => {
ready_callback(qemu_process)
})
qemu_process.stdout.on('data', waitForKey)
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
qemu_process.stdin.write(`echo "${pubkeyContent}" > /root/.ssh/authorized_keys\n`);
qemu_process.stdin.write(`cat /root/.ssh/authorized_keys\n`);
let waitForKey = waitFor(pubkeyContent, () => {
ready_callback(qemu_process)
})
})
qemu_process.stdout.on('data', (data) => {
waitForPrompt(data)
Expand Down
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,14 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
qemu_process.stdin.write("root\n");
let waitForPrompt = waitFor("root@freebsd:", () => {
waitForPrompt = () => { }
let waitForKey = waitFor(pubkeyContent, () => {
ready_callback(qemu_process)
})
qemu_process.stdout.on('data', waitForKey)
qemu_process.stdin.write("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config\n");
qemu_process.stdin.write("/etc/rc.d/sshd restart\n");
qemu_process.stdin.write(`echo "${pubkeyContent}" > /root/.ssh/authorized_keys\n`);
qemu_process.stdin.write(`cat /root/.ssh/authorized_keys\n`);
let waitForKey = waitFor(pubkeyContent, () => {
ready_callback(qemu_process)
})
})
qemu_process.stdout.on('data', (data) => {
waitForPrompt(data)
Expand Down

0 comments on commit e2db402

Please sign in to comment.