From 4d5fb23ad827eda17b64676f527c3f168cd56ebd Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 20 Jul 2012 10:38:15 -0500 Subject: [PATCH] lxc-clone: fix handling of lxc.mount entries The 'lxc.mount =' entry can have more than one space, or tabs, before the =. We only need to disambiguate from 'lxc.mount.entry'. So just check for a space or tab after mount. Signed-off-by: Serge Hallyn --- src/lxc/lxc-clone.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-clone.in b/src/lxc/lxc-clone.in index 9292e101e..d9ed78c42 100644 --- a/src/lxc/lxc-clone.in +++ b/src/lxc/lxc-clone.in @@ -176,7 +176,7 @@ cp $lxc_path/$lxc_orig/config $lxc_path/$lxc_new/config sed -i '/lxc.utsname/d' $lxc_path/$lxc_new/config echo "lxc.utsname = $hostname" >> $lxc_path/$lxc_new/config -grep "lxc.mount =" $lxc_path/$lxc_new/config >/dev/null 2>&1 && { sed -i '/lxc.mount =/d' $lxc_path/$lxc_new/config; echo "lxc.mount = $lxc_path/$lxc_new/fstab" >> $lxc_path/$lxc_new/config; } +grep "lxc.mount[ \t]" $lxc_path/$lxc_new/config >/dev/null 2>&1 && { sed -i '/lxc.mount[ \t]/d' $lxc_path/$lxc_new/config; echo "lxc.mount = $lxc_path/$lxc_new/fstab" >> $lxc_path/$lxc_new/config; } if [ -e $lxc_path/$lxc_orig/fstab ];then cp $lxc_path/$lxc_orig/fstab $lxc_path/$lxc_new/fstab