]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-oci: fix Cmd/Entrypoint parsing
authorFelix Abecassis <fabecassis@nvidia.com>
Thu, 29 Mar 2018 17:20:31 +0000 (10:20 -0700)
committerFelix Abecassis <fabecassis@nvidia.com>
Thu, 29 Mar 2018 17:20:31 +0000 (10:20 -0700)
Don't use the -r option of jq, since it will strip the double quotes.

Fixes: #2195
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
templates/lxc-oci.in

index d843a079e21be449b014d7fcbfdfddd1592e3f60..4dca46ac045be56b5fbb1608bdc3f5ea465b59bb 100644 (file)
@@ -100,8 +100,8 @@ getep() {
 
   configpath="$1"
 
-  ep=$(jq -c -r '.config.Entrypoint[]?'< "${configpath}")
-  cmd=$(jq -c -r '.config.Cmd[]?' < "${configpath}")
+  ep=$(jq -c '.config.Entrypoint[]?'< "${configpath}" | tr '\n' ' ')
+  cmd=$(jq -c '.config.Cmd[]?'< "${configpath}" | tr '\n' ' ')
   if [ -z "${ep}" ]; then
     ep="${cmd}"
     if [ -z "${ep}" ]; then