From 4f6dd48802b25a56882f84fb807e58dcd6a55d55 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Sun, 23 Jul 2017 23:11:11 -0500 Subject: [PATCH] Clean up tmp directory when finished. --- virtualmin-install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index 10d7ad5..19a532b 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -748,6 +748,14 @@ kill "$config_system_pid" 1>/dev/null 2>&1 # Make sure the cursor is back (if spinners misbehaved) tput cnorm +# Cleanup the tmp files +if [ "$tempdir" != "" ] && [ "$tempdir" != "/" ]; then + log_info "Cleaning up temporary files in $tmpdir." + find "$tempdir" -delete +else + log_error "Could not safely clean up temporary files because TMPDIR set to $tempdir." +fi + if [ ! -z "$QUOTA_FAILED" ]; then log_warning "Quotas were not configurable. A reboot may be required. Or, if this is" log_warning "a VM, configuration may be required at the host level."