#!/usr/bin/sh # SPDX-License-Identifier: LGPL-2.1+ # Make sure the usual locations are in PATH export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin set -e usage() { cat <" keys we # encounter with "lxc.network..". echo "${LINE}" | grep -q "lxc.network.type" && IDX=$((IDX+1)) 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}"