Refactored destructor

This commit is contained in:
2020-06-11 12:19:19 +02:00
parent aa2eb62e77
commit a8d099144e
3 changed files with 13 additions and 22 deletions

View File

@@ -7,15 +7,6 @@ source "$(dirname "$(readlink -f "${0}")")/base.sh" || (echo "Loading base.sh fa
info "Setupscript for images started..."
info "Define functions..."
destructor(){
info "Cleaning up..."
umount_everything
rmdir -v "$root_mount_path" || warning "Removing $root_mount_path failed!"
rmdir -v "$boot_mount_path" || warning "Removing $boot_mount_path failed!"
rmdir -v "$working_folder_path" || warning "Removing $working_folder_path failed!"
}
info "Checking if root..."
if [ "$(id -u)" != "0" ];then
error "This script must be executed as root!"