Deal correct with filenames with spaces
This commit is contained in:
parent
cc814aef37
commit
e09797b0c9
|
@ -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}
|
||||
|
|
Reference in New Issue