From 332070658337a6c93cb1339f40e669627c1572db Mon Sep 17 00:00:00 2001 From: Axel ROGER Date: Mon, 15 Oct 2012 09:59:21 +0000 Subject: [PATCH] Quotes added to directory vars (MUST ALWAYS BE IN QUOTES!) --- src/update_mails.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/update_mails.sh b/src/update_mails.sh index 74b31203..6eae8b18 100755 --- a/src/update_mails.sh +++ b/src/update_mails.sh @@ -55,10 +55,10 @@ mysql_query "SELECT id, quote(replace(path,'!','\\!')) FROM mailbox WHERE mail_a # If no dir, DELETE # If dir and rm ok, DELETE # Other case, do nothing - if [ -d $path ] ; then - $ionice rm -rf $path && mysql_query "DELETE FROM mailbox WHERE id=$id AND mail_action='DELETING';" + if [ -d "$path" ] ; then + $ionice rm -rf "$path" && mysql_query "DELETE FROM mailbox WHERE id=$id AND mail_action='DELETING';" # Do the rm again in case of newly added file during delete. Should not be usefull - test -d $path && $ionice rm -rf $path + test -d "$path" && $ionice rm -rf $path else mysql_query "DELETE FROM mailbox WHERE id=$id AND mail_action='DELETING';" fi