summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-07-14 20:40:53 +0200
committerErich Eckner <git@eckner.net>2016-07-14 20:40:53 +0200
commit8a613f2e9eaa326b8c9baa5200a1f85de1c6ebba (patch)
treee98cf65ab6ee79ed5b3ca50c995b7433396e78d6
parentc824c9ed1cad93f3c46ae5efd0c7488180e25a29 (diff)
downloadcryptfs-daemon-8a613f2e9eaa326b8c9baa5200a1f85de1c6ebba.tar.xz
mountpoint und findmnt statt grep-Magie
-rw-r--r--cryptfs.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/cryptfs.in b/cryptfs.in
index d184a9c..db4403c 100644
--- a/cryptfs.in
+++ b/cryptfs.in
@@ -25,7 +25,7 @@ start)
for neededKeyFs in ${neededKeyFss}
do
- if ! mount | grep -q "^\S\+\s\+on\s\+${neededKeyFs}\s"
+ if ! mountpoint -q "${neededKeyFs}"
then
if echo "${fsTab}" | grep -q "^\(ssh\|ftp\)fs#\S*\s\+${neededKeyFs}\s"
then
@@ -59,10 +59,10 @@ start)
for cryptedFs in ${cryptedFss}
do
- if ! mount | grep -q "^${cryptedFs}\s"
+ if ! findmnt --source "${cryptedFs}" > /dev/null
then
- e2fsck ${cryptedFs}
- mount ${cryptedFs} || exit $?
+ e2fsck "${cryptedFs}"
+ mount "${cryptedFs}" || exit $?
fi
done
@@ -72,9 +72,9 @@ stop)
for cryptedFs in ${cryptedFss}
do
- if mount | grep -q "^${cryptedFs}\s"
+ if findmnt --source "${cryptedFs}" > /dev/null
then
- umount ${cryptedFs} || exit $?
+ umount "${cryptedFs}" || exit $?
fi
done
@@ -88,7 +88,7 @@ stop)
for neededKeyFs in ${neededKeyFss}
do
- if [ ! "${neededKeyFs}" == "/" ] && mount | grep -q "^\S\+\s\+on\s\+${neededKeyFs}\s"
+ if [ ! "${neededKeyFs}" == "/" ] && mountpoint -q "${neededKeyFs}"
then
umount ${neededKeyFs} || exit $?
fi