diff options
author | Roy Marples <roy@marples.name> | 2007-09-24 15:27:06 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-09-24 15:27:06 +0000 |
commit | ccfbb4ad457a16357221ac7f7594717bbf3d05ee (patch) | |
tree | f8d4c486f47b7abf81f171001976041bbf0269c0 | |
parent | da90cc630ee7ea777485c1da01686f1e44e6fa36 (diff) |
Use mkdir to test. Also, quote for robustness
-rwxr-xr-x | init.d/bootmisc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/init.d/bootmisc b/init.d/bootmisc index b475ab82..9968dabe 100755 --- a/init.d/bootmisc +++ b/init.d/bootmisc @@ -12,8 +12,8 @@ depend() { cleanup_tmp_dir() { local dir=$1 - mkdir -p ${dir} - cd ${dir} + mkdir -p "${dir}" + cd "${dir}" if [ "${WIPE_TMP}" = "yes" ] ; then ebegin "Wiping ${dir} directory" local startopts="-x . -depth" @@ -39,9 +39,10 @@ cleanup_tmp_dir() { eend 0 else ebegin "Cleaning ${dir} directory" - rm -rf ${dir}/.X*-lock ${dir}/esrv* ${dir}/kio* ${dir}/jpsock.* \ - ${dir}/.fam* ${dir}/.esd* ${dir}/orbit-* ${dir}/ssh-* \ - ${dir}/ksocket-* ${dir}/.*-unix + rm -rf "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \ + "${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \ + "${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* + "${dir}"/.*-unix eend 0 fi } @@ -50,8 +51,7 @@ start() { # Put a nologin file in /etc to prevent people from logging # in before system startup is complete. if [ "${DELAYLOGIN}" = "yes" ] ; then - echo "System bootup in progress - please wait" \ - > /etc/nologin + echo "System bootup in progress - please wait" > /etc/nologin cp /etc/nologin /etc/nologin.boot fi @@ -63,11 +63,11 @@ start() { fi fi - if ! echo 2>/dev/null >/.test.$$ ; then + if ! mkdir /.test.$$ 2>/dev/null ; then ewarn "Skipping /var and /tmp initialization (ro root?)" return 0 fi - rm -f /.test.$$ + rmdir /.test.$$ # Ensure that our basic dirs exist for x in /var/lock /var/log /var/run /tmp ; do @@ -125,7 +125,7 @@ start() { # Clean up /tmp directories local tmp for tmp in ${WIPE_TMP_DIRS-/tmp} ; do - cleanup_tmp_dir ${tmp} + cleanup_tmp_dir "${tmp}" done chmod +t /tmp /var/tmp |