diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2026-09-23 15:21:40 -0700 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2026-10-11 18:33:35 -0700 |
| commit | d4613833149d35a16c881b83de5f54833a5f55f0 (patch) | |
| tree | d448ed2f54ced56c11b0f2bc7b62ab6eb5f3cfaf /build-openbsd-image.sh | |
| parent | Fix SSH key and use multiple cpus during the build (diff) | |
| download | site-server-images-d4613833149d35a16c881b83de5f54833a5f55f0.zip | |
Configure cpus for openbsd image build dynamically
Diffstat (limited to 'build-openbsd-image.sh')
| -rwxr-xr-x | build-openbsd-image.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/build-openbsd-image.sh b/build-openbsd-image.sh index b31ebfa..17f2145 100755 --- a/build-openbsd-image.sh +++ b/build-openbsd-image.sh @@ -25,6 +25,7 @@ main() ( -var "disk_size=$DISK_SIZE_GB" \ -var "version=$VERSION" \ -var "ssh_key=$(cat "$PUBLIC_SSH_KEY")" \ + -var "cpus=$(get_ncpus)" \ . ) @@ -55,4 +56,12 @@ parse_args() { done } +get_ncpus() { + if [ "$(uname -s)" = 'Darwin' ]; then + sysctl -n hw.ncpu + else + nproc + fi +} + main "$@" |