rule-generator: make sure /etc/udev/rules.d/ exists prior to trying to write to it

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
This commit is contained in:
Ian Stakenvicius 2013-07-09 15:31:19 -04:00
parent e1dda94b63
commit 77d68de482
1 changed files with 4 additions and 0 deletions

View File

@ -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