From f33689fdbcb329f04dbe865ac2625274a0c6f110 Mon Sep 17 00:00:00 2001 From: age Date: Thu, 16 Jun 2005 22:48:37 +0000 Subject: [PATCH] mount grep klappt --- spielspass/dmcrypt-wrapper.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spielspass/dmcrypt-wrapper.sh b/spielspass/dmcrypt-wrapper.sh index c57608e..c388733 100755 --- a/spielspass/dmcrypt-wrapper.sh +++ b/spielspass/dmcrypt-wrapper.sh @@ -12,9 +12,8 @@ crypt_mount() { local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1` for i in $partitions; do - #if mount | grep -q "^/dev/mapper/$i$"; then - # this doesn't work for me (age) - if [ `mount | grep -c /dev/mapper/$i` -lt 1 ]; then + if mount | grep -q "^/dev/mapper/$i$"; then + #if [ `mount | grep -c /dev/mapper/$i` -lt 1 ]; then echo -en "\t$i(mounting)" mount "/dev/mapper/$i" &>/dev/null || echo -en "(failed)" >&2 else echo -en "\t$i(already mounted)" @@ -28,8 +27,8 @@ crypt_umount() { local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1` for i in $partitions; do - #if mount | grep -q "^/dev/mapper/$i$"; then - if [ `mount | grep -c /dev/mapper/$i` -gt 0 ]; then + if mount | grep -q "^/dev/mapper/$i$"; then + #if [ `mount | grep -c /dev/mapper/$i` -gt 0 ]; then echo -en "\t$i (unmounting)" umount "/dev/mapper/$i" &>/dev/null || echo -en "(failed!)" >&2 else echo -en "\t$i(not mounted)"