summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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