mount grep klappt
This commit is contained in:
parent
765758598f
commit
f33689fdbc
1 changed files with 4 additions and 5 deletions
|
@ -12,9 +12,8 @@ crypt_mount()
|
||||||
{
|
{
|
||||||
local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1`
|
local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1`
|
||||||
for i in $partitions; do
|
for i in $partitions; do
|
||||||
#if mount | grep -q "^/dev/mapper/$i$"; then
|
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 -c /dev/mapper/$i` -lt 1 ]; then
|
|
||||||
echo -en "\t$i(mounting)"
|
echo -en "\t$i(mounting)"
|
||||||
mount "/dev/mapper/$i" &>/dev/null || echo -en "(failed)" >&2
|
mount "/dev/mapper/$i" &>/dev/null || echo -en "(failed)" >&2
|
||||||
else echo -en "\t$i(already mounted)"
|
else echo -en "\t$i(already mounted)"
|
||||||
|
@ -28,8 +27,8 @@ crypt_umount()
|
||||||
{
|
{
|
||||||
local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1`
|
local partitions=`dmsetup ls | grep -v "No devices found" | cut -f1`
|
||||||
for i in $partitions; do
|
for i in $partitions; do
|
||||||
#if mount | grep -q "^/dev/mapper/$i$"; then
|
if mount | grep -q "^/dev/mapper/$i$"; then
|
||||||
if [ `mount | grep -c /dev/mapper/$i` -gt 0 ]; then
|
#if [ `mount | grep -c /dev/mapper/$i` -gt 0 ]; then
|
||||||
echo -en "\t$i (unmounting)"
|
echo -en "\t$i (unmounting)"
|
||||||
umount "/dev/mapper/$i" &>/dev/null || echo -en "(failed!)" >&2
|
umount "/dev/mapper/$i" &>/dev/null || echo -en "(failed!)" >&2
|
||||||
else echo -en "\t$i(not mounted)"
|
else echo -en "\t$i(not mounted)"
|
||||||
|
|
Loading…
Reference in a new issue