summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-12-11 13:53:16 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-12-11 13:53:16 +0100
commitf154d48b5fc0b2fffaf1b1d7a8b2c28dbac7df65 (patch)
tree7b50c8140b1cce2770d79818af9337bd2adcfdab /src
parent0df35eb24a7b7b12eba06eaf3bd17e1b233dc722 (diff)
escape / in awk
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index 6d8401c..89dc675 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -61,7 +61,8 @@ target_umountall()
{
infofy "Disabling all swapspace..." disks
swapoff -a >/dev/null 2>&1
- for mountpoint in $(mount | awk "/\/$var_TARGET_DIR/ {print \$3}" | sort | tac )
+ declare target=${var_TARGET_DIR//\//\\/} # escape all slashes otherwise awk complains
+ for mountpoint in $(mount | awk "/\/$target/ {print \$3}" | sort | tac )
do
infofy "Unmounting mountpoint $mountpoint" disks
umount $mountpoint >/dev/null 2>$LOG