Commit 853d58fd by Elan Ruusamäe Committed by Stéphane Graber

use awk, instead of 'grep | awk'

parent 1b29d73c
...@@ -427,7 +427,7 @@ fi ...@@ -427,7 +427,7 @@ fi
# check for 'lxc.rootfs' passed in through default config by lxc-create # check for 'lxc.rootfs' passed in through default config by lxc-create
if [ -z "$rootfs_path" ]; then if [ -z "$rootfs_path" ]; then
if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
rootfs_path=`grep 'lxc.rootfs =' $path/config | awk -F= '{ print $2 }'` rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
else else
rootfs_path=$path/$name/rootfs rootfs_path=$path/$name/rootfs
fi fi
......
...@@ -341,7 +341,7 @@ fi ...@@ -341,7 +341,7 @@ fi
config="$path/config" config="$path/config"
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -383,7 +383,7 @@ fi ...@@ -383,7 +383,7 @@ fi
config="$path/config" config="$path/config"
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -1030,7 +1030,7 @@ if [ -z "$rootfs_path" ]; then ...@@ -1030,7 +1030,7 @@ if [ -z "$rootfs_path" ]; then
rootfs_path=$path/rootfs rootfs_path=$path/rootfs
# check for 'lxc.rootfs' passed in through default config by lxc-create # check for 'lxc.rootfs' passed in through default config by lxc-create
if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
rootfs_path=`grep 'lxc.rootfs =' $path/config | awk -F= '{ print $2 }'` rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
fi fi
fi fi
config_path=$default_path/$name config_path=$default_path/$name
......
...@@ -420,7 +420,7 @@ fi ...@@ -420,7 +420,7 @@ fi
# check for 'lxc.rootfs' passed in through default config by lxc-create # check for 'lxc.rootfs' passed in through default config by lxc-create
if [ -z "$rootfs_path" ]; then if [ -z "$rootfs_path" ]; then
if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
rootfs_path=`grep 'lxc.rootfs =' $path/config | awk -F= '{ print $2 }'` rootfs_path=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
else else
rootfs_path=$path/$name/rootfs rootfs_path=$path/$name/rootfs
fi fi
......
...@@ -390,7 +390,7 @@ fi ...@@ -390,7 +390,7 @@ fi
config="$path/config" config="$path/config"
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -367,7 +367,7 @@ dlcache=$cache/cache-${prog##*-}-$release-$arch ...@@ -367,7 +367,7 @@ dlcache=$cache/cache-${prog##*-}-$release-$arch
rtcache=$cache/rootfs-${prog##*-}-$release-$arch rtcache=$cache/rootfs-${prog##*-}-$release-$arch
if [ -z "$rootfs" ] ; then if [ -z "$rootfs" ] ; then
if grep -q "^lxc.rootfs" $path/config ; then if grep -q "^lxc.rootfs" $path/config ; then
rootfs=`grep "^lxc.rootfs" $path/config | awk -F= '{print $2}'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $path/config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -237,7 +237,7 @@ fi ...@@ -237,7 +237,7 @@ fi
config="$path/config" config="$path/config"
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -293,7 +293,7 @@ fi ...@@ -293,7 +293,7 @@ fi
config="$path/config" config="$path/config"
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
...@@ -669,7 +669,7 @@ config="$path/config" ...@@ -669,7 +669,7 @@ config="$path/config"
# if $rootfs exists here, it was passed in with --rootfs # if $rootfs exists here, it was passed in with --rootfs
if [ -z "$rootfs" ]; then if [ -z "$rootfs" ]; then
if grep -q '^lxc.rootfs' $config 2>/dev/null ; then if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
rootfs=`grep 'lxc.rootfs =' $config | awk -F= '{ print $2 }'` rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
else else
rootfs=$path/rootfs rootfs=$path/rootfs
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment