fix unmount issus when dir is not mount

This commit is contained in:
Izimic 2021-01-01 09:17:19 +01:00
parent db8639b893
commit 6ae820e254

View File

@ -234,7 +234,7 @@ class RootFS::RootFS
def unmount(directory = nil)
if directory
execute "umount '#{@directory}/#{directory}'"
execute "mountpoint -q '#{@directory}/#{directory}' || exit 0 && umount '#{@directory}/#{directory}'"
return
end