From 04a30f4b312cbcdcab7c28af19a00b5556d41de2 Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Sun, 12 Aug 2012 01:55:18 +0100 Subject: [PATCH] Improve update cleanup to prevent auth messages after every command --- init/msm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/init/msm b/init/msm index a74faf8..026dc8f 100755 --- a/init/msm +++ b/init/msm @@ -1982,6 +1982,14 @@ command_update() { # Create the temp download directory local output_dir="/tmp/msmupdate" + # Clean up the temp directory created for downloads + cleanup() { + as_user "$SETTINGS_USERNAME" "rm -rf \"${output_dir}\"" + } + + # Remove the directory if it exists already + cleanup + # $1: The file name to download download_file() { local dir_name="$(dirname "${output_dir}/${1}")" @@ -2235,6 +2243,8 @@ command_update() { echo "MSM was not updated." fi + cleanup + # This script will now be replaced. So run the new script's # update code, incase there are new things to update that # this version of MSM does not know about yet. @@ -3764,10 +3774,6 @@ interrupt() { fi done - # Clean up the temp directory created for downloads - manager_property USERNAME - as_user "$SETTINGS_USERNAME" "rm -rf \"${output_dir}\"" - exit }