aboutsummaryrefslogtreecommitdiff
path: root/arch-tmpfiles
diff options
context:
space:
mode:
Diffstat (limited to 'arch-tmpfiles')
-rwxr-xr-xarch-tmpfiles9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch-tmpfiles b/arch-tmpfiles
index f133a40..73c4328 100755
--- a/arch-tmpfiles
+++ b/arch-tmpfiles
@@ -87,17 +87,18 @@ _D() {
# Create or empty a directory
local path=$1 mode=$2 uid=$3 gid=$4
- (( CREATE )) || return 0
-
if ! checkparams 4 "$@"; then
warninvalid
return
fi
- if [[ -d $path ]]; then
+ if [[ -d $path ]] && (( REMOVE )); then
find "$path" -mindepth 1 -maxdepth 1 -xdev -print0 | xargs -r0 rm -rf
fi
- install -d -m"$mode" -o"$uid" -g"$gid" "$path"
+
+ if (( CREATE )); then
+ install -d -m"$mode" -o"$uid" -g"$gid" "$path"
+ fi
}
_p() {