#!/usr/bin/env sh # SPDX-License-Identifier: AGPL-3.0-or-later set -eu is_positive_int() { case "${1:-}" in '' | 0* | *[!0-9]*) return 1 ;; *) [ "$1" -gt 0 ] ;; esac } available_cpu_count() { cpu_quota="" cpu_period="" if [ -r /sys/fs/cgroup/cpu.max ]; then read -r cpu_quota cpu_period