summaryrefslogtreecommitdiff
path: root/rule_generator
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2013-07-09 15:31:19 -0400
committerIan Stakenvicius <axs@gentoo.org>2013-07-10 10:52:13 -0400
commit77d68de482a8a9dc20f0cdb84c6887d3ca12b97d (patch)
treee2e69b17cc7d1f5df9b968272e7935265bb627f4 /rule_generator
parente1dda94b63efdbb502fc592f96e07af61ea4fb0e (diff)
rule-generator: make sure /etc/udev/rules.d/ exists prior to trying to write to it
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Diffstat (limited to 'rule_generator')
-rw-r--r--rule_generator/rule_generator.functions4
1 files changed, 4 insertions, 0 deletions
diff --git a/rule_generator/rule_generator.functions b/rule_generator/rule_generator.functions
index a6e9c8c4d8..ea02acc4c7 100644
--- a/rule_generator/rule_generator.functions
+++ b/rule_generator/rule_generator.functions
@@ -76,6 +76,10 @@ choose_rules_file() {
local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
[ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
+ [ -d "${RULES_FILE%/*}" ] || if writeable ${RULES_FILE%/rules.d/*}; then
+ mkdir -p "${RULES_FILE%/*}"
+ fi
+
if writeable ${RULES_FILE%/*}; then
RO_RULES_FILE='/dev/null'
else