summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-11-11 09:19:40 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-11-14 07:46:57 -0200
commite09797b0c9f7bb1c6e81a6b282d6aeb127820b77 (patch)
tree149d355549f802793e4c7f064cb2ba7d6ecb7de7
parentcc814aef37698c2cb13862b8285cc09ff666af7e (diff)
downloadpfsense-e09797b0c9f7bb1c6e81a6b282d6aeb127820b77.zip
pfsense-e09797b0c9f7bb1c6e81a6b282d6aeb127820b77.tar.gz
Deal correct with filenames with spaces
-rwxr-xr-xtmp/post_upgrade_command11
1 files changed, 9 insertions, 2 deletions
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}
OpenPOWER on IntegriCloud