]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
extrahd: Do not try to umount if nothing is mounted
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Aug 2023 09:14:15 +0000 (09:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Aug 2023 09:14:46 +0000 (09:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/extrahd/extrahd.pl

index eba3f9b37bfe162575cfca2472b50380f7629d58..145a2a43a1c255ca7f315d4126e4eb7ce5c5f0da 100644 (file)
@@ -80,6 +80,11 @@ extrahd_umount() {
                        continue
                fi
 
+               # Do not try to umount if nothing is mounted
+               if ! mountpoint "${mountpoint}" &>/dev/null; then
+                       continue
+               fi
+
                # Umount and try lazy umount if failed
                if umount --quiet --recursive "${mountpoint}" || \
                                umount --quiet --recursive --lazy "${mountpoint}"; then