diff options
author | Roy Marples <roy@marples.name> | 2008-01-25 12:33:53 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-01-25 12:33:53 +0000 |
commit | 829f4d281cd7a3ee36cdb6a75d1347aacf478669 (patch) | |
tree | 1878dcfee1789949f9cc15993164bcb73b8a8f19 /init.d/bootmisc | |
parent | 8793fb8d4c1f134a2e341cc921d5f8e17869483b (diff) |
Hack around busybox find / rm not handling -- correctly.
Diffstat (limited to 'init.d/bootmisc')
-rwxr-xr-x | init.d/bootmisc | 15 |
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 |