1 | #!/bin/bash␊ |
2 | ␊ |
3 | echo "==============================================="␊ |
4 | echo "Unmount all volumes named EFI"␊ |
5 | echo "*****************************"␊ |
6 | ␊ |
7 | # loop through and un-mount ALL mounted EFI system partitions - Thanks kizwan␊ |
8 | ␊ |
9 | attempts=1␊ |
10 | while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do␊ |
11 | ␉echo "Unmounting $( df | grep EFI | awk '{print $1}' )"␊ |
12 | ␉umount -f $( df | grep EFI | awk '{print $1}' )␊ |
13 | ␉attempts=$(( ${attempts} + 1 ))␊ |
14 | done␊ |
15 | if [ ${attempts} = 5 ]; then␊ |
16 | ␉echo "failed to unmount EFI System Partition."␊ |
17 | ␉echo "-----------------------------------------------"␊ |
18 | ␉echo ""␊ |
19 | ␉echo ""␊ |
20 | ␉echo ""␊ |
21 | ␉exit 1␊ |
22 | fi␊ |
23 | ␊ |
24 | echo "-----------------------------------------------"␊ |
25 | echo ""␊ |
26 | echo ""␊ |
27 | echo ""␊ |
28 | ␊ |
29 | exit 0␊ |
30 | ␊ |
31 | ␊ |
32 | ␊ |
33 | |