Addendum: If you like your temporary folders to be removed use the following line between do and done:
echo "${dir}" | awk '{system("umount " $0); system("rm -rf " $0);}'
Addendum:
If you like your temporary folders to be removed use the following line between do and done:
echo "${dir}" | awk '{system("umount " $0); system("rm -rf " $0);}'