Unverified Commit e932b5c0 by Christian Brauner Committed by GitHub

Merge pull request #2370 from jsurloppe/fix-lxc-update-config

Patch lxc-update-config
parents 30c8676e 49b8273f
......@@ -102,7 +102,10 @@ while read -r LINE; do
# one we bump IDX and replace any "lxc.network.<subkey>" keys we
# encounter with "lxc.network.<IDX>.<subkey>".
echo "${LINE}" | grep -q "lxc.network.type" && IDX=$((IDX+1))
sed -i -e "${LINE_NUM} s/\([[:blank:]*]\|#*\)\(lxc\.network\)\.\([^[:digit:]*]\)/\1lxc\.net\.${IDX}\.\3/g" "${CONFIGPATH}"
sed -i \
-e "${LINE_NUM} s/\([[:blank:]*]\|#*\)\(lxc\.network\)\(\.ipv[[:digit:]]\)\([[:blank:]]*\)=\(.*\)/\1lxc\.net\.${IDX}\3\.address\4=\5/g" \
-e "${LINE_NUM} s/\([[:blank:]*]\|#*\)\(lxc\.network\)\.\([^[:digit:]*]\)/\1lxc\.net\.${IDX}\.\3/g" \
"${CONFIGPATH}"
done < "${TMPFILE}"
rm "${TMPFILE}"
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