[X2Go-Commits] [live-build-x2go] 80/167: only attempt umount when path is a mounted device / improved logging

git-admin at x2go.org git-admin at x2go.org
Sat Nov 18 00:32:46 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox-magic-pixel-workaround
in repository live-build-x2go.

commit 0f3306f02bd5db2f95dae7229a3109201bb813bb
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date:   Tue Jul 25 00:23:52 2017 +0200

    only attempt umount when path is a mounted device / improved logging
---
 config/includes.chroot/lib/live/config/2400-live-autoupdate | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate
index cdcc34f..b384aec 100755
--- a/config/includes.chroot/lib/live/config/2400-live-autoupdate
+++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate
@@ -38,10 +38,13 @@ cleanup ()
 		echo "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'."
 	fi
 	if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then
-		if umount $MOUNTPOINT; then
-			echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'."
-		else
-			echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'."
+		if grep -q "$MOUNTPOINT" /proc/mounts ; then
+			echo "\n$(date +'%F | %T | ')'$0': '$MOUNTPOINT' is mounted, attempting umount."
+			if umount $MOUNTPOINT; then
+				echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'."
+			else
+				echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'."
+			fi
 		fi
 	fi
 }

--
Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git


More information about the x2go-commits mailing list