Update util-iso-mount.sh

This commit is contained in:
Philip Müller 2021-07-20 09:07:52 +00:00
parent 7a6459172e
commit 9e9b793aab

View file

@ -59,24 +59,10 @@ mount_fs_net(){
track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1" track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
} }
check_mount() { check_umount() {
busy=true if [[ mountpoint -q "$1" ]]; then
while $busy umount -l "$1"
do fi
if mountpoint -q "$1"
then
umount -l "$1" 2> /dev/null
if [ $? -eq 0 ]
then
busy=false # umount successful
else
echo -n '.' # output to show that the script is alive
sleep 5 # 5 seconds for testing, modify to 300 seconds later on
fi
else
busy=false # not mounted
fi
done
} }
umount_fs(){ umount_fs(){
@ -87,7 +73,7 @@ umount_fs(){
for i in "${FS_ACTIVE_MOUNTS[@]}" for i in "${FS_ACTIVE_MOUNTS[@]}"
do do
cat /proc/mounts cat /proc/mounts
check_mount $i check_umount $i
cat /proc/mounts cat /proc/mounts
done done
unset FS_ACTIVE_MOUNTS unset FS_ACTIVE_MOUNTS