From cb570384b98cc5ae01273ed6dd9110ea2d6de71f Mon Sep 17 00:00:00 2001 From: Dan Kelleher Date: Tue, 25 Aug 2015 14:48:13 -0400 Subject: [PATCH] Fix a typo and use blkid flags Instead of using grep and cut use only the blkid flags to output SWAP_DRIVES. --- base/etc/one-context.d/04-mount-swap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/etc/one-context.d/04-mount-swap b/base/etc/one-context.d/04-mount-swap index 06881e0..78967fc 100755 --- a/base/etc/one-context.d/04-mount-swap +++ b/base/etc/one-context.d/04-mount-swap @@ -2,9 +2,9 @@ activate_swaps() { - SWAP_DRIVES=$(blkid | grep 'TYPE=\"swap\"' | cut -d':' -f1) + SWAP_DRIVES=$(blkid -t TYPE="swap" -o device) for SWAP in $SWAP_DRIVES ; do - if [ -z "$(swapon -s | grep $SWAP)"]; then + if [ -z "$(swapon -s | grep $SWAP)" ]; then swapon $SWAP fi done