From 6deaed52e97bf3d9dfefd259af2461ac48356ff3 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 3 Dec 2023 13:19:35 +0100 Subject: [PATCH] add reboot.sh --- .github/workflows/build.yml | 2 +- .github/workflows/manual.yml | 2 +- build.sh | 40 +++++++++++++++++++++++++++++------- conf/openbsd-7.1.conf | 2 +- conf/openbsd-7.2.conf | 2 +- conf/openbsd-7.3.conf | 2 +- conf/openbsd-7.4.conf | 2 +- 7 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c54d66..65b0a3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: env: SEC_VBOX : ${{ secrets.SEC_VBOX }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Creating Web console uses: vmactions/cf-tunnel@v0 id: tunnel diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 7e67549..7aec6f3 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -13,7 +13,7 @@ jobs: NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }} SEC_VBOX : ${{ secrets.SEC_VBOX }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: vmactions/cf-tunnel@v0 id: tunnel with: diff --git a/build.sh b/build.sh index a2cb5ac..2facda4 100644 --- a/build.sh +++ b/build.sh @@ -30,6 +30,8 @@ vmsh="$VM_VBOX" export VM_OS_NAME export VM_RELEASE +export VM_OCR +export VM_DISK ############################################################## @@ -104,6 +106,7 @@ sleep 5 $vmsh startVM $osname +sleep 2 ############################################### @@ -192,6 +195,34 @@ if [ "$VM_PRE_INSTALL_PKGS" ]; then ssh $osname sh <<<"$VM_INSTALL_CMD $VM_PRE_INSTALL_PKGS" fi + +#upload reboot.sh +if [ -e "hooks/reboot.sh" ]; then + echo "hooks/reboot.sh" + cat "hooks/reboot.sh" + scp hooks/reboot.sh $osname:/reboot.sh +else + ssh "$osname" "cat - >/reboot.sh" </dev/null; then +crontab -l | { cat; echo "@reboot /reboot.sh"; } | crontab -- +else +crontab -l | { cat; echo "@reboot /reboot.sh"; } | crontab - +fi +crontab -l + +EOF + + ssh $osname "$VM_SHUTDOWN_CMD" sleep 5 @@ -227,14 +258,9 @@ echo "Checking the packages: $VM_RSYNC_PKG $VM_SSHFS_PKG" if [ -z "$VM_RSYNC_PKG$VM_SSHFS_PKG" ]; then echo "skip" else + $vmsh addSSHAuthorizedKeys $osname-$VM_RELEASE-id_rsa.pub $vmsh startVM $osname - - waitForText "penBSD/amd64" - - sleep 20 - - waitForText "logi" - + $vmsh waitForVMReady $osname ssh $osname sh <<<"$VM_INSTALL_CMD $VM_RSYNC_PKG $VM_SSHFS_PKG" fi diff --git a/conf/openbsd-7.1.conf b/conf/openbsd-7.1.conf index 7e093f9..9621e43 100644 --- a/conf/openbsd-7.1.conf +++ b/conf/openbsd-7.1.conf @@ -22,4 +22,4 @@ VM_OPTS="conf/openbsd-7.1.opts.txt" VM_VBOX="./vbox.sh" -VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.0.3/vbox.sh" \ No newline at end of file +VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.4/vbox.sh" \ No newline at end of file diff --git a/conf/openbsd-7.2.conf b/conf/openbsd-7.2.conf index ec2b9b8..f42c04e 100644 --- a/conf/openbsd-7.2.conf +++ b/conf/openbsd-7.2.conf @@ -23,4 +23,4 @@ VM_OPTS="conf/openbsd-7.2.resp" VM_VBOX="./vbox.sh" -VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.2/vbox.sh" \ No newline at end of file +VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.4/vbox.sh" \ No newline at end of file diff --git a/conf/openbsd-7.3.conf b/conf/openbsd-7.3.conf index 0c5d794..c4ad1db 100644 --- a/conf/openbsd-7.3.conf +++ b/conf/openbsd-7.3.conf @@ -23,4 +23,4 @@ VM_OPTS="conf/openbsd-7.3.resp" VM_VBOX="./vbox.sh" -VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.2/vbox.sh" \ No newline at end of file +VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.4/vbox.sh" \ No newline at end of file diff --git a/conf/openbsd-7.4.conf b/conf/openbsd-7.4.conf index 5f43ad5..7ae8da2 100644 --- a/conf/openbsd-7.4.conf +++ b/conf/openbsd-7.4.conf @@ -23,4 +23,4 @@ VM_OPTS="conf/openbsd-7.4.resp" VM_VBOX="./vbox.sh" -VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.2/vbox.sh" \ No newline at end of file +VM_VBOX_LINK="https://raw.githubusercontent.com/vmactions/vbox/v0.9.4/vbox.sh" \ No newline at end of file