opt: optimize monitorrule check

This commit is contained in:
DreamMaoMao 2026-02-26 08:54:15 +08:00
parent cbc344ab88
commit 4787402b12

View file

@ -1844,6 +1844,13 @@ bool parse_option(Config *config, char *key, char *value) {
token = strtok(NULL, ",");
}
if (!rule->name && !rule->make && !rule->model && !rule->serial) {
fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Monitor rule "
"must have at least one of the following "
"options: name, make, model, serial\n");
return false;
}
config->monitor_rules_count++;
return !parse_error;
} else if (strcmp(key, "tagrule") == 0) {