aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'init.d')
-rwxr-xr-xinit.d/bootmisc15
1 files changed, 10 insertions, 5 deletions
diff --git a/init.d/bootmisc b/init.d/bootmisc
index 286ca61c..a66c93f3 100755
--- a/init.d/bootmisc
+++ b/init.d/bootmisc
@@ -18,11 +18,16 @@ cleanup_tmp_dir()
cd "${dir}"
if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then
ebegin "Wiping ${dir} directory"
- local startopts="-x . -depth"
- [ "${RC_UNAME}" = "Linux" ] && startopts=". -xdev -depth"
+ local startopts="-x . -depth" delete="-exec rm -rf -- {} ;"
+
+ if [ "${RC_UNAME}" = "Linux" ]; then
+ startopts=". -xdev -depth"
+ # busybox find / rm cannot handle --
+ delete="-delete"
+ fi
# Faster than find
- rm -rf [b-ikm-pr-zA-Z]*
+ rm -rf -- [b-ikm-pr-zA-Z0-9\.]*
find ${startopts} ! -name . \
! -path ./lost+found \
@@ -37,12 +42,12 @@ cleanup_tmp_dir()
! -path "./aquota.group/*" \
! -path ./journal \
! -path "./journal/*" \
- -exec rm -rf -- {} \; \
+ ${delete} \
-type d -prune
eend 0
else
ebegin "Cleaning ${dir} directory"
- rm -rf "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \
+ rm -rf -- "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \
"${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \
"${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* \
"${dir}"/.*-unix