]> git.proxmox.com Git - mirror_lxc.git/commitdiff
use awk, instead of 'grep | awk'
authorElan Ruusamäe <glen@delfi.ee>
Mon, 18 Nov 2013 23:23:33 +0000 (01:23 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Nov 2013 16:15:12 +0000 (11:15 -0500)
Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-altlinux.in
templates/lxc-busybox.in
templates/lxc-debian.in
templates/lxc-fedora.in
templates/lxc-openmandriva.in
templates/lxc-opensuse.in
templates/lxc-plamo.in
templates/lxc-sshd.in
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in

index c8de4e44f8c271ae76790e87ea0a2e5254bff7ee..559ba75e8ff164fd792b97292edb34931a84fce0 100644 (file)
@@ -427,7 +427,7 @@ fi
 # check for 'lxc.rootfs' passed in through default config by lxc-create
 if [ -z "$rootfs_path" ]; 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
         rootfs_path=$path/$name/rootfs
     fi
index 25125e4c5ea7539d6d5171178e50fc691d013212..23d654e0da33c4b6dd594c038d7a003634ee00b9 100644 (file)
@@ -341,7 +341,7 @@ fi
 config="$path/config"
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi
index 645fe8d73117ac6bfc0184de34011ced32a88161..cd69cebe8ce5b7df218eb7a5c5e523a028e24b50 100644 (file)
@@ -383,7 +383,7 @@ fi
 config="$path/config"
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi
index 747bfd5a35036012ef51f78bf02e03f8acca0e97..eaa7ce47927a1272a72f2b63930c1898c81a64db 100644 (file)
@@ -1030,7 +1030,7 @@ if [ -z "$rootfs_path" ]; then
     rootfs_path=$path/rootfs
     # check for 'lxc.rootfs' passed in through default config by lxc-create
     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
 config_path=$default_path/$name
index e51333cf9aea6586764abd69816f71ca59de8445..3a1fa2734f8356d4c952cb83718429ef9c2ed04f 100644 (file)
@@ -420,7 +420,7 @@ fi
 # check for 'lxc.rootfs' passed in through default config by lxc-create
 if [ -z "$rootfs_path" ]; 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
         rootfs_path=$path/$name/rootfs
     fi
index c8004fd30390f81fd634f2866e145d88bb45b11f..88f7742aba7e751355083696114fd31d319953f1 100644 (file)
@@ -390,7 +390,7 @@ fi
 config="$path/config"
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi
index fa05cd130d40b17aec7beea0aecfd41f88cce251..bc4f80bca64a45ed610f7f3d7cdf676284115564 100644 (file)
@@ -367,7 +367,7 @@ dlcache=$cache/cache-${prog##*-}-$release-$arch
 rtcache=$cache/rootfs-${prog##*-}-$release-$arch
 if [ -z "$rootfs" ] ; 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
     rootfs=$path/rootfs
   fi
index 0d4a5027377330c78df59c7858be9182fb88a429..622f8220b3d1ea5b5eba81a1c56178e92a53eb1c 100644 (file)
@@ -237,7 +237,7 @@ fi
 config="$path/config"
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi
index aeadc2dbd9d8876de155ad1d280c629ad416948d..09c6626273ad8515706dffd670b0c99983b8419e 100644 (file)
@@ -293,7 +293,7 @@ fi
 config="$path/config"
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi
index 3e296d83fea1168d5873e1a839bee6d842c19147..eb8cdebfb0e2b251879bc0ead543417cd52b3719 100644 (file)
@@ -669,7 +669,7 @@ config="$path/config"
 # if $rootfs exists here, it was passed in with --rootfs
 if [ -z "$rootfs" ]; 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
         rootfs=$path/rootfs
     fi