diff options
author | Erich Eckner <git@eckner.net> | 2016-07-14 20:40:53 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-07-14 20:40:53 +0200 |
commit | 8a613f2e9eaa326b8c9baa5200a1f85de1c6ebba (patch) | |
tree | e98cf65ab6ee79ed5b3ca50c995b7433396e78d6 | |
parent | c824c9ed1cad93f3c46ae5efd0c7488180e25a29 (diff) | |
download | cryptfs-daemon-8a613f2e9eaa326b8c9baa5200a1f85de1c6ebba.tar.xz |
mountpoint und findmnt statt grep-Magie
-rw-r--r-- | cryptfs.in | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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 |