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 }