q.max_running_tasks = 1;
}
+static int trigger_match(const char *event, const char *match)
+{
+ char *wildcard = strstr(match, ".*");
+ if (wildcard)
+ return strncmp(event, match, wildcard - match);
+ return strcmp(event, match);
+}
+
void trigger_event(const char *type, struct blob_attr *data)
{
struct trigger *t;
list_for_each_entry(t, &triggers, list) {
if (t->pending || t->remove)
continue;
- if (!strcmp(t->type, type)) {
+ if (!trigger_match(type, t->type)) {
if (t->timeout) {
free(t->data);
t->data = blob_memdup(data);
char *str;
str = blobmsg_format_json(msg, true);
- LOG("Received ubus notify '%s': %s\n", method, str);
+ DEBUG(3, "Received ubus notify '%s': %s\n", method, str);
free(str);
}