From 829f4d281cd7a3ee36cdb6a75d1347aacf478669 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 25 Jan 2008 12:33:53 +0000 Subject: Hack around busybox find / rm not handling -- correctly. --- init.d/bootmisc | 15 ++++++++++----- 1 file 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 -- cgit v1.2.3