Groot: Do not umount directories that are not mountpoint

This commit is contained in:
Filippo Squillace 2017-04-19 23:52:26 +01:00
parent b9e34d3e96
commit 137788a98a
2 changed files with 41 additions and 7 deletions

View file

@ -43,7 +43,7 @@ function chroot_teardown() {
local final_res=0
for mp in $($CAT $MOUNTS_FILE | $CUT -f2 -d' ' | $SORT -r | $UNIQ)
do
if [[ $mp =~ ^${normalized_chrootdir}.* ]]
if [[ $mp =~ ^${normalized_chrootdir}.* ]] && $MOUNTPOINT -q "$mp"
then
$UMOUNT $mp || final_res=$?
fi