Use mkdir to test. Also, quote for robustness
This commit is contained in:
parent
da90cc630e
commit
ccfbb4ad45
@ -12,8 +12,8 @@ depend() {
|
|||||||
cleanup_tmp_dir() {
|
cleanup_tmp_dir() {
|
||||||
local dir=$1
|
local dir=$1
|
||||||
|
|
||||||
mkdir -p ${dir}
|
mkdir -p "${dir}"
|
||||||
cd ${dir}
|
cd "${dir}"
|
||||||
if [ "${WIPE_TMP}" = "yes" ] ; then
|
if [ "${WIPE_TMP}" = "yes" ] ; then
|
||||||
ebegin "Wiping ${dir} directory"
|
ebegin "Wiping ${dir} directory"
|
||||||
local startopts="-x . -depth"
|
local startopts="-x . -depth"
|
||||||
@ -39,9 +39,10 @@ cleanup_tmp_dir() {
|
|||||||
eend 0
|
eend 0
|
||||||
else
|
else
|
||||||
ebegin "Cleaning ${dir} directory"
|
ebegin "Cleaning ${dir} directory"
|
||||||
rm -rf ${dir}/.X*-lock ${dir}/esrv* ${dir}/kio* ${dir}/jpsock.* \
|
rm -rf "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \
|
||||||
${dir}/.fam* ${dir}/.esd* ${dir}/orbit-* ${dir}/ssh-* \
|
"${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \
|
||||||
${dir}/ksocket-* ${dir}/.*-unix
|
"${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-*
|
||||||
|
"${dir}"/.*-unix
|
||||||
eend 0
|
eend 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -50,8 +51,7 @@ start() {
|
|||||||
# Put a nologin file in /etc to prevent people from logging
|
# Put a nologin file in /etc to prevent people from logging
|
||||||
# in before system startup is complete.
|
# in before system startup is complete.
|
||||||
if [ "${DELAYLOGIN}" = "yes" ] ; then
|
if [ "${DELAYLOGIN}" = "yes" ] ; then
|
||||||
echo "System bootup in progress - please wait" \
|
echo "System bootup in progress - please wait" > /etc/nologin
|
||||||
> /etc/nologin
|
|
||||||
cp /etc/nologin /etc/nologin.boot
|
cp /etc/nologin /etc/nologin.boot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -63,11 +63,11 @@ start() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! echo 2>/dev/null >/.test.$$ ; then
|
if ! mkdir /.test.$$ 2>/dev/null ; then
|
||||||
ewarn "Skipping /var and /tmp initialization (ro root?)"
|
ewarn "Skipping /var and /tmp initialization (ro root?)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
rm -f /.test.$$
|
rmdir /.test.$$
|
||||||
|
|
||||||
# Ensure that our basic dirs exist
|
# Ensure that our basic dirs exist
|
||||||
for x in /var/lock /var/log /var/run /tmp ; do
|
for x in /var/lock /var/log /var/run /tmp ; do
|
||||||
@ -125,7 +125,7 @@ start() {
|
|||||||
# Clean up /tmp directories
|
# Clean up /tmp directories
|
||||||
local tmp
|
local tmp
|
||||||
for tmp in ${WIPE_TMP_DIRS-/tmp} ; do
|
for tmp in ${WIPE_TMP_DIRS-/tmp} ; do
|
||||||
cleanup_tmp_dir ${tmp}
|
cleanup_tmp_dir "${tmp}"
|
||||||
done
|
done
|
||||||
chmod +t /tmp /var/tmp
|
chmod +t /tmp /var/tmp
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user