mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
start ssh
This commit is contained in:
parent
955eb9fb52
commit
476629cee9
1 changed files with 7 additions and 0 deletions
7
.github/workflows/build-and-test.yml
vendored
7
.github/workflows/build-and-test.yml
vendored
|
|
@ -227,6 +227,13 @@ jobs:
|
||||||
(tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) &
|
(tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) &
|
||||||
|
|
||||||
timeout 30m bash -c "while ! (grep 'login:' vm.stdout); do sleep 1; done"
|
timeout 30m bash -c "while ! (grep 'login:' vm.stdout); do sleep 1; done"
|
||||||
|
echo "${VM_USER}" >> vm.stdin
|
||||||
|
timeout 30m bash -c "while ! (grep 'Password:' vm.stdout); do sleep 1; done"
|
||||||
|
echo "${VM_Pass}" >> vm.stdin
|
||||||
|
echo > vm.stdout
|
||||||
|
timeout 30m bash -c "while ! (grep '#\|\$' vm.stdout); do sleep 1; done"
|
||||||
|
echo "sudo systemctl start sshd" >> vm.stdin
|
||||||
|
( timeout 30m bash -c "while ! (grep 'Password' vm.stdout); do sleep 1; done" && echo "${VM_PASS}" >> vm.stdin ) || true
|
||||||
|
|
||||||
export VM_IP=$({ echo '{"execute": "guest-network-get-interfaces"}'; sleep 2; } | socat unix-connect:/tmp/qga.sock - | jq -r '.return[1]["ip-addresses"][] | select(."ip-address-type"=="ipv4") | .["ip-address"]')
|
export VM_IP=$({ echo '{"execute": "guest-network-get-interfaces"}'; sleep 2; } | socat unix-connect:/tmp/qga.sock - | jq -r '.return[1]["ip-addresses"][] | select(."ip-address-type"=="ipv4") | .["ip-address"]')
|
||||||
if ! (echo > /dev/tcp/${VM_IP}/22)
|
if ! (echo > /dev/tcp/${VM_IP}/22)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue