chiark / gitweb /
[PATCH] add RUN key to be able to run rule based notification
[elogind.git] / udev_rules_parse.c
index 3c1631ab49c54590bd1cf86fb0e75d1d6ca127f7..e665957b81c652ac007d18871c3caaadf2c240a2 100644 (file)
@@ -256,6 +256,13 @@ static int rules_parse(const char *filename)
                                continue;
                        }
 
+                       if (strcasecmp(key, KEY_ACTION) == 0) {
+                               strlcpy(rule.action, value, sizeof(rule.action));
+                               rule.action_operation = operation;
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(key, KEY_BUS) == 0) {
                                strlcpy(rule.bus, value, sizeof(rule.bus));
                                rule.bus_operation = operation;
@@ -379,6 +386,12 @@ static int rules_parse(const char *filename)
                                continue;
                        }
 
+                       if (strcasecmp(key, KEY_RUN) == 0) {
+                               strlcpy(rule.run, value, sizeof(rule.run));
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(key, KEY_OPTIONS) == 0) {
                                if (strstr(value, OPTION_LAST_RULE) != NULL) {
                                        dbg("last rule to be applied");