summaryrefslogtreecommitdiff
path: root/backend/modules/cleanup
blob: adced9331b6702e11662bf6e2b4c53da7f7e55f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

function cleanup()
{
	
        cd /
        umount "$TARGET/proc" &>/dev/null
        umount "$TARGET/dev" &>/dev/null
        umount "$TARGET/sys" &>/dev/null
	umount_all_affected "$(hdmap_get device of mountpoint /)" &>/dev/null
        umount "$TARGET" &>/dev/null
        umount "/live/filesystem" &>/dev/null
	rmdir "$TARGET" "/live/filesystem" &>/dev/null
	if [ -d /live/filesystem.main ]; then
		umount "/live/filesystem.main" &>/dev/null
		rmdir "/live/filesystem.main" &>/dev/null
	fi
}