aboutsummaryrefslogtreecommitdiffstats
path: root/build-openbsd-image.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-09-23 15:56:25 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-11 18:33:35 -0700
commite7d2d6d8a72a2e32f331c1ae4e1ee8511e460cee (patch)
treeb23d59fb0d8e50a64e8e1d8915d4237ff560987c /build-openbsd-image.sh
parentConfigure cpus for openbsd image build dynamically (diff)
downloadsite-server-images-e7d2d6d8a72a2e32f331c1ae4e1ee8511e460cee.zip
Add prompt to remove build directory if it exists
If the build directory exists, the packer build will abort.
Diffstat (limited to 'build-openbsd-image.sh')
-rwxr-xr-xbuild-openbsd-image.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build-openbsd-image.sh b/build-openbsd-image.sh
index 17f2145..faa6bc1 100755
--- a/build-openbsd-image.sh
+++ b/build-openbsd-image.sh
@@ -18,6 +18,20 @@ export PACKER_LOG=1
main() (
parse_args "$@"
cd openbsd-image/
+ if [ -d build/ ]; then
+ printf 'Build directory exists. Must delete before re-building. Proceed? (y/N)'
+ read -r answer
+ case $answer in
+ [yY])
+ echo "Removing build/.."
+ rm -r build/
+ ;;
+ *)
+ echo "Aborting.."
+ exit 0
+ ;;
+ esac
+ fi
packer init .
packer build \
-only "qemu.openbsd-$ARCH" \