Improve update cleanup to prevent auth messages after every command

This commit is contained in:
Marcus Whybrow 2012-08-12 01:55:18 +01:00
parent 7affffda32
commit 04a30f4b31

View File

@ -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
}