Deal correct with filenames with spaces

This commit is contained in:
Renato Botelho 2014-11-11 09:19:40 -02:00
parent cc814aef37
commit e09797b0c9
1 changed files with 9 additions and 2 deletions

View File

@ -39,14 +39,21 @@ if [ "${PFSENSETYPE}" = "nanobsd" -a -f /etc/localtime ]; then
/bin/cp -p /etc/localtime ${ROOT}etc/localtime 2>/dev/null
fi
# Files may contain spaces
oIFS=${IFS}
IFS="
"
# Obsolete files - nanobsd doesn't need it since a new image is installed
# on the other partition
if [ "${PFSENSETYPE}" != "nanobsd" -a -f /etc/pfSense.obsoletedfiles ]; then
for f in $(cat /etc/pfSense.obsoletedfiles); do
if [ -n "${f}" -a -f "${f}" ]; then
rm -f ${f}
rm -f "${f}"
elif [ -n "${f}" -a -d "${f}" ]; then
rm -rf ${f}
rm -rf "${f}"
fi
done
fi
# Restore IFS
IFS=${oIFS}