From e09797b0c9f7bb1c6e81a6b282d6aeb127820b77 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 11 Nov 2014 09:19:40 -0200 Subject: Deal correct with filenames with spaces --- tmp/post_upgrade_command | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tmp') diff --git a/tmp/post_upgrade_command b/tmp/post_upgrade_command index de4c286..b42ad51 100755 --- a/tmp/post_upgrade_command +++ b/tmp/post_upgrade_command @@ -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} -- cgit v1.1