* stricter validation reject nonsense quotas like "0%" and "09%" and "199%" mostly just a nitpick * oops forgot a line * Update main.sh
@@ -1161,8 +1161,9 @@ is_cron_format_valid() {
# Validate CPU Quota:
is_valid_cpu_quota() {
- if [[ ! "$1" =~ ^[0-9]+%$ ]]; then
- check_result "$E_INVALID" "Invalid CPU Quota format :: $1"
+ local cpu_quota="$1"
+ if [[ ! "$cpu_quota" =~ ^[1-9][0-9]*%$ ]]; then
+ check_result "$E_INVALID" "Invalid CPU Quota format: $cpu_quota"
fi
}